From d5adabcd5c05f0e23cef104e8301a0ae03e675b6 Mon Sep 17 00:00:00 2001 From: CRIMINAL Date: Sun, 13 Jun 2021 04:08:50 +0100 Subject: [PATCH] Fixed custom filenames --- apis/api_helper.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apis/api_helper.py b/apis/api_helper.py index 942395dd0..69531d9eb 100644 --- a/apis/api_helper.py +++ b/apis/api_helper.py @@ -18,14 +18,19 @@ import python_socks import requests from aiohttp import ClientSession -from aiohttp.client_exceptions import (ClientConnectorError, ClientOSError, - ClientPayloadError, ContentTypeError, - ServerDisconnectedError) +from aiohttp.client_exceptions import ( + ClientConnectorError, + ClientOSError, + ClientPayloadError, + ContentTypeError, + ServerDisconnectedError, +) from aiohttp.client_reqrep import ClientResponse from aiohttp_socks import ChainProxyConnector, ProxyConnector, ProxyType from database.models.media_table import media_table from apis.onlyfans.classes import create_user +from yarl import URL path = up(up(os.path.realpath(__file__))) os.chdir(path) @@ -273,7 +278,8 @@ async def check(download_item: media_table, response: ClientResponse): temp_response = [ response for response in responses - if response and response.url.name == download_item.filename + if response + and URL.human_repr(response.url) == download_item.link ] if temp_response: temp_response = temp_response[0]