domini CF dinamici (by alfa), aggiornamento url

This commit is contained in:
marco
2020-05-05 18:34:30 +02:00
parent 9b4e464c94
commit c0cc4bdb2f
2 changed files with 80 additions and 56 deletions
+8 -9
View File
@@ -1,7 +1,7 @@
{ {
"altadefinizione01": "https://altadefinizione01.photo", "altadefinizione01": "https://altadefinizione01.photo",
"altadefinizione01_link": "https://altadefinizione01.gallery", "altadefinizione01_link": "https://altadefinizione01.gallery",
"altadefinizioneclick": "https://altadefinizione.studio", "altadefinizioneclick": "https://altadefinizione.family",
"animeforce": "https://ww1.animeforce.org", "animeforce": "https://ww1.animeforce.org",
"animeleggendari": "https://animepertutti.org", "animeleggendari": "https://animepertutti.org",
"animesaturn": "https://www.animesaturn.com", "animesaturn": "https://www.animesaturn.com",
@@ -10,10 +10,9 @@
"animetubeita": "http://www.animetubeita.com", "animetubeita": "http://www.animetubeita.com",
"animeunity": "https://www.animeunity.it", "animeunity": "https://www.animeunity.it",
"animeworld": "https://www.animeworld.tv", "animeworld": "https://www.animeworld.tv",
"casacinema": "https://www.casacinema.me", "casacinema": "https://www.casacinema.digital",
"casacinemaInfo": "https://casacinema.life", "casacinemaInfo": "https://casacinema.life",
"cb01anime": "https://www.cineblog01.network", "cb01anime": "https://www.cineblog01.network/",
"cineblog01": "https://cb01-nuovo-indirizzo.info",
"cinemalibero": "https://cinemalibero.plus", "cinemalibero": "https://cinemalibero.plus",
"cinetecadibologna": "http://cinestore.cinetecadibologna.it", "cinetecadibologna": "http://cinestore.cinetecadibologna.it",
"dreamsub": "https://dreamsub.stream", "dreamsub": "https://dreamsub.stream",
@@ -24,13 +23,13 @@
"filmsenzalimiticc": "https://www.filmsenzalimiti.estate", "filmsenzalimiticc": "https://www.filmsenzalimiti.estate",
"filmstreaming01": "https://filmstreaming01.com", "filmstreaming01": "https://filmstreaming01.com",
"guardaserie_stream": "https://guardaserie.store", "guardaserie_stream": "https://guardaserie.store",
"guardaserieclick": "https://www.guardaserie.band", "guardaserieclick": "https://www.guardaserie.style",
"hd4me": "https://hd4me.net", "hd4me": "https://hd4me.net",
"ilgeniodellostreaming": "https://ilgeniodellostreaming.tk", "ilgeniodellostreaming": "https://ilgeniodellostreaming.tw",
"italiaserie": "https://italiaserie.org", "italiaserie": "https://italiaserie.org",
"mondoserietv": "https://mondoserietv.com", "mondoserietv": "https://mondoserietv.com",
"netfreex": "https://www.netfreex.club", "netfreex": "https://www.netfreex.club",
"piratestreaming": "https://www.piratestreaming.online", "piratestreaming": "https://www.piratestreaming.biz",
"polpotv": "https://polpotv.club", "polpotv": "https://polpotv.club",
"pufimovies": "https://pufimovies.com", "pufimovies": "https://pufimovies.com",
"raiplay": "https://www.raiplay.it", "raiplay": "https://www.raiplay.it",
@@ -38,9 +37,9 @@
"serietvonline": "https://serietvonline.host", "serietvonline": "https://serietvonline.host",
"serietvsubita": "http://serietvsubita.xyz", "serietvsubita": "http://serietvsubita.xyz",
"serietvu": "https://www.serietvu.link", "serietvu": "https://www.serietvu.link",
"streamingaltadefinizione": "https://www.popcornstream.website/", "streamingaltadefinizione": "https://www.popcornstream.press",
"streamtime": "https://t.me/s/StreamTime", "streamtime": "https://t.me/s/StreamTime",
"tantifilm": "https://www.tantifilm.bar", "tantifilm": "https://www.tantifilm.pizza",
"toonitalia": "https://toonitalia.org", "toonitalia": "https://toonitalia.org",
"vedohd": "https://vedohd.uno", "vedohd": "https://vedohd.uno",
"vvvvid": "https://www.vvvvid.it" "vvvvid": "https://www.vvvvid.it"
+37 -12
View File
@@ -41,12 +41,23 @@ if HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT == 0: HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT =
# Random use of User-Agents, if nad is not specified # Random use of User-Agents, if nad is not specified
HTTPTOOLS_DEFAULT_RANDOM_HEADERS = False HTTPTOOLS_DEFAULT_RANDOM_HEADERS = False
domainCF = list() # old
channelsCF = ['guardaserieclick', 'casacinema', 'dreamsub', 'ilgeniodellostreaming', 'piratestreaming', 'altadefinizioneclick', 'altadefinizione01_link'] # domainCF = list()
otherCF = ['altadefinizione-nuovo.link', 'akvideo.stream', 'backin.net', 'vcrypt.net'] # channelsCF = ['guardaserieclick', 'ilgeniodellostreaming']
for ch in channelsCF: # otherCF = ['akvideo.stream', 'backin.net', 'vcrypt.net']
domainCF.append(urlparse.urlparse(config.get_channel_url(name=ch)).hostname) # for ch in channelsCF:
domainCF.extend(otherCF) # domainCF.append(urlparse.urlparse(config.get_channel_url(name=ch)).hostname)
# domainCF.extend(otherCF)
global CF_LIST
CF_LIST = list()
CF_LIST_PATH = os.path.join(config.get_data_path(), "CF_Domains.txt")
if os.path.exists(CF_LIST_PATH):
with open(CF_LIST_PATH, "rb") as CF_File:
CF_LIST = CF_File.read().splitlines()
FORCE_CLOUDSCRAPER_LIST = ['akvideo.stream']
def get_user_agent(): def get_user_agent():
# Returns the global user agent to be used when necessary for the url. # Returns the global user agent to be used when necessary for the url.
@@ -257,14 +268,20 @@ def downloadpage(url, **opt):
""" """
url = scrapertools.unescape(url) url = scrapertools.unescape(url)
domain = urlparse.urlparse(url).netloc domain = urlparse.urlparse(url).netloc
global domainCF global CF_LIST
CF = False CF = False
if domain in domainCF or opt.get('cf', False):
url = 'https://web.archive.org/save/' + url
CF = True
from lib import requests if domain in FORCE_CLOUDSCRAPER_LIST:
session = requests.session() 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):
url = 'https://web.archive.org/save/' + url
CF = True
if config.get_setting('resolver_dns') and not opt.get('use_requests', False): if config.get_setting('resolver_dns') and not opt.get('use_requests', False):
from specials import resolverdns from specials import resolverdns
@@ -382,6 +399,14 @@ def downloadpage(url, **opt):
response_code = req.status_code response_code = req.status_code
if req.headers.get('Server', '').startswith('cloudflare') and response_code in [429, 503, 403] and not opt.get('CF', False):
if domain not in CF_LIST:
opt["CF"] = True
with open(CF_LIST_PATH, "a") as CF_File:
CF_File.write("%s\n" % domain)
logger.debug("CF retry... for domain: %s" % domain)
return downloadpage(url, **opt)
response['data'] = req.content if req.content else '' response['data'] = req.content if req.content else ''
if CF: if CF:
import re import re