Fix AnimeUnity e riaggiunto Cloudscraper

This commit is contained in:
Alhaziel01
2020-07-15 20:37:21 +02:00
parent 83561cc68a
commit f55673b391
24 changed files with 16518 additions and 65 deletions
+8 -8
View File
@@ -56,7 +56,7 @@ HTTPTOOLS_DEFAULT_RANDOM_HEADERS = False
# with open(CF_LIST_PATH, "rb") as CF_File:
# CF_LIST = CF_File.read().splitlines()
# FORCE_CLOUDSCRAPER_LIST = []
FORCE_CLOUDSCRAPER_LIST = []
def get_user_agent():
# Returns the global user agent to be used when necessary for the url.
@@ -270,13 +270,13 @@ def downloadpage(url, **opt):
# global CF_LIST
CF = False
# if domain in FORCE_CLOUDSCRAPER_LIST:
# from lib import cloudscraper
# session = cloudscraper.create_scraper()
# CF = True
# else:
from lib import requests
session = requests.session()
if domain in FORCE_CLOUDSCRAPER_LIST or opt.get('cf', False):
from lib import cloudscraper
session = cloudscraper.create_scraper()
CF = True
else:
from lib import requests
session = requests.session()
# if domain in CF_LIST or opt.get('CF', False):
if opt.get('CF', False):