From 180ad74948663cf75aabc74bee8e96cd3a9e9890 Mon Sep 17 00:00:00 2001 From: Mosney Date: Sun, 29 Nov 2020 18:32:55 +0800 Subject: [PATCH] fix proxy config not work --- ADC_function.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ADC_function.py b/ADC_function.py index 9bd8805..824b6d4 100755 --- a/ADC_function.py +++ b/ADC_function.py @@ -50,7 +50,7 @@ def get_html(url, cookies: dict = None, ua: str = None, return_type: str = None) for i in range(retry_count): try: - if switch == 1: + if switch == '1' or switch == 1: result = requests.get(str(url), headers=headers, timeout=timeout, proxies=proxies, cookies=cookies) else: result = requests.get(str(url), headers=headers, timeout=timeout, cookies=cookies) @@ -76,7 +76,7 @@ def post_html(url: str, query: dict) -> requests.Response: for i in range(retry_count): try: - if switch == 1: + if switch == 1 or switch == '1': result = requests.post(url, data=query, proxies=proxies,headers=headers, timeout=timeout) else: result = requests.post(url, data=query, headers=headers, timeout=timeout) @@ -97,7 +97,7 @@ def get_javlib_cookie() -> [dict, str]: # Get __cfduid/cf_clearance and user-agent for i in range(retry_count): try: - if switch == 1: + if switch == 1 or switch == '1': raw_cookie, user_agent = cloudscraper.get_cookie_string( "http://www.m45e.com/", proxies=proxies