Test Nuovo launcher

This commit is contained in:
Alhaziel01
2021-12-11 19:55:18 +01:00
parent a588b44c9c
commit 3bd5d636e1
6 changed files with 296 additions and 389 deletions
+37 -34
View File
@@ -74,20 +74,15 @@ def search(item, text):
def peliculas(item):
search = item.search
anime = True
# debug = True
if 'movie' in item.url:
action = 'findvideos'
else:
action = 'check'
action = 'check'
# if not item.args:
# pagination = ''
# patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
# else:
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
if search:
patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>.*?)(?: Sub| sub| SUB|")'
if item.args == 'newest': item.action = 'findvideos'
patronNext = '<li class="page-item disabled">(?:[^>]+>){4}<a class="page-link" href="([^"]+)'
def itemHook(item):
@@ -100,7 +95,7 @@ def peliculas(item):
def check(item):
m = support.match(item, headers=headers, patron=r'Tipologia[^>]+><a href="([^"]+)"')
m = support.match(item, headers=headers, patron=r'Tipologia[^>]+>\s*<a href="([^"]+)"')
item.data = m.data
if 'movie' in m.match:
item.contentType = 'movie'
@@ -112,6 +107,7 @@ def check(item):
@support.scrape
def episodios(item):
anime = True
pagination = 50
data = item.data
if '<h6>Streaming</h6>' in data:
@@ -130,30 +126,37 @@ def episodios(item):
def findvideos(item):
support.info(item)
itemlist = []
if 'adf.ly' in item.url:
from servers.decrypters import adfly
url = adfly.get_long_url(item.url)
elif 'bit.ly' in item.url:
url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
if item.data:
url = support.match(item.data, patron=r'<a\s*href="([^"]+)"\s*title="[^"]+"\s*class="btn btn-dark mb-1">').match
else:
url = host
for u in item.url.split('/'):
if u and 'animeforce' not in u and 'http' not in u:
url += '/' + u
url = item.url
if 'php?' in url:
url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
else:
if item.data: url = item.data
url = support.match(url, patron=r'data-href="([^"]+)" target').match
if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
if url.startswith('//'): url = 'https:' + url
elif url.startswith('/'): url = 'https:/' + url
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
else: itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), url=url, server='directo'))
# if 'adf.ly' in item.url:
# from servers.decrypters import adfly
# url = adfly.get_long_url(item.url)
# elif 'bit.ly' in item.url:
# url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
# else:
# url = host
# for u in item.url.split('/'):
# if u and 'animeforce' not in u and 'http' not in u:
# url += '/' + u
# if 'php?' in url:
# url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
# url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
# else:
# if item.data: url = item.data
# if item.contentType == 'movie': url = support.match()
# url = support.match(url, patron=r'data-href="([^"]+)" target').match
# if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
# if url.startswith('//'): url = 'https:' + url
# elif url.startswith('/'): url = 'https:/' + url
url = support.match(url, patron=r'data-href="([^"]+)" target').match
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
else: itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), url=url, server='directo'))
return support.server(item, itemlist=itemlist)
+12 -12
View File
@@ -54,7 +54,7 @@ def search(item, texto):
item.url = host + "/?s=" + texto
try:
item.contentType = 'undefined'
item.args = 'search'
return peliculas(item)
# Continua la ricerca in caso di errore
@@ -78,11 +78,11 @@ def newest(categoria):
@support.scrape
def peliculas(item):
if item.contentType == 'undefined':
action = 'check'
action = 'check'
item.contentType == 'undefined'
if item.args == 'search':
patron = r'<a href="(?P<url>[^"]+)" title="Permalink to\s*(?P<title>[^"]+) \((?P<year>[0-9]+)[^<]*\)[^"]*"[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)".*?<div class="calitate">\s*<p>(?P<quality>[^<]+)<\/p>'
else:
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
patronNext = r'<a class="nextpostslink" rel="next" href="([^"]+)">'
patron = r'<div class="mediaWrap mediaWrapAlt">\s*<a href="(?P<url>[^"]+)"(?:[^>]+)?>?\s*(?:<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>\s*)?<\/a>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+?)(?P<lang>[sS][uU][bB]\-[iI][tT][aA]+)?(?:[ ]?\((?P<year>\d{4})-?(?:\d{4})?)\).[^<]+[^>]+><\/a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<quality>[a-zA-Z-0-9\.]+)?'
patronBlock = r'<div id="main_col">(?P<block>.*?)<!\-\- main_col \-\->'
@@ -139,14 +139,14 @@ def check(item):
if 'sub' in check.lower():
item.contentLanguage = 'Sub-ITA'
logger.debug("CHECK : ", check)
if 'anime' in check.lower():
item.contentType = 'tvshow'
logger.debug('select = ### è una anime ###')
try:
return episodios(item)
except:
pass
elif 'serie' in check.lower():
# if 'anime' in check.lower():
# item.contentType = 'tvshow'
# logger.debug('select = ### è una anime ###')
# try:
# return episodios(item)
# except:
# pass
if 'serie' in check.lower():
item.contentType = 'tvshow'
return episodios(item)
else: