Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2020-07-15 23:02:10 +02:00
31 changed files with 16592 additions and 286 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):