Migliorato support.match e sostituito ove usato
- Fix Animeforce - Fix AnimeSubITA
This commit is contained in:
+91
-52
@@ -3,14 +3,11 @@
|
|||||||
# Canale per AnimeForce
|
# Canale per AnimeForce
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from servers.decrypters import adfly
|
|
||||||
from core import support
|
from core import support
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
IDIOMAS = {'Italiano': 'IT'}
|
list_servers = ['directo', 'vvvvid']
|
||||||
list_language = IDIOMAS.values()
|
|
||||||
list_servers = ['directo', 'openload', 'vvvvid']
|
|
||||||
list_quality = ['default']
|
list_quality = ['default']
|
||||||
|
|
||||||
|
|
||||||
@@ -45,47 +42,40 @@ def newest(categoria):
|
|||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
# debug = True
|
support.log(texto)
|
||||||
search = texto
|
item.args = 'noorder'
|
||||||
|
item.url = host + '/?s=' + texto + '&cat=6010'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<strong[^>]+>(?P<title>[^<]+)<'
|
try:
|
||||||
action = 'episodios'
|
return peliculas(item)
|
||||||
return locals()
|
# Continua la ricerca in caso di errore
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
support.logger.error("%s" % line)
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
anime = True
|
anime = True
|
||||||
action = 'episodios'
|
action = 'episodios'
|
||||||
|
if not item.args:
|
||||||
if item.args == 'newest':
|
pagination = ''
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
||||||
action = 'findvideos'
|
|
||||||
|
|
||||||
elif item.args == 'last':
|
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
|
||||||
|
|
||||||
elif item.args == 'corso':
|
elif item.args == 'corso':
|
||||||
pagination = ''
|
pagination = ''
|
||||||
patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
||||||
else:
|
else:
|
||||||
pagination = ''
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<strong[^>]+>(?P<title>[^<]+)<'
|
|
||||||
|
if item.args == 'newest': item.action = 'findvideos'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if 'sub-ita' in item.url:
|
if 'sub-ita' in item.url:
|
||||||
if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA','_ [] color kod')
|
if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA','_ [] color kod')
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
if item.args == 'newest':
|
|
||||||
url = support.match(item, '<a href="([^"]+)" title="[^"]+" target="[^"]+" class="btn', headers=headers)[0]
|
|
||||||
item.url = url[0] if url else ''
|
|
||||||
delete = support.scrapertools.find_single_match(item.fulltitle, r'( Episodi.*)')
|
|
||||||
episode = support.scrapertools.find_single_match(item.title, r'Episodi(?:o)? (?:\d+÷)?(\d+)')
|
|
||||||
item.title = support.typo(episode + ' - ','bold') + item.title.replace(delete,'')
|
|
||||||
item.fulltitle = item.show = item.title.replace(delete,'')
|
|
||||||
item.episode = episode
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
@@ -94,9 +84,15 @@ def peliculas(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime = True
|
anime = True
|
||||||
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
data = support.match(item, headers=headers).data
|
||||||
|
if '<h6>Streaming</h6>' in data:
|
||||||
|
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
||||||
|
else:
|
||||||
|
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.url = item.url.replace(host, '')
|
support.log(item)
|
||||||
|
if item.url.startswith('//'): item.url= 'https:' + item.url
|
||||||
|
elif item.url.startswith('/'): item.url= 'https:/' + item.url
|
||||||
return item
|
return item
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
return locals()
|
return locals()
|
||||||
@@ -104,38 +100,81 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.log(item)
|
support.log(item)
|
||||||
|
# try:
|
||||||
|
# from urlparse import urljoin
|
||||||
|
# except:
|
||||||
|
# from urllib.parse import urljoin
|
||||||
|
# support.dbg()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.episode:
|
|
||||||
from lib import unshortenit
|
|
||||||
url, c = unshortenit.unshorten(item.url)
|
|
||||||
url = support.match(item, r'<a href="([^"]+)"[^>]*>', patronBlock=r'Episodio %s(.*?)</tr>' % item.episode ,url=url)[0]
|
|
||||||
item.url = url[0] if url else ''
|
|
||||||
|
|
||||||
if 'vvvvid' in item.url:
|
if 'vvvvid' in item.url:
|
||||||
item.action = 'play'
|
import requests
|
||||||
itemlist.append(item)
|
from lib import vvvvid_decoder
|
||||||
|
|
||||||
|
if support.match(item.url, string=True, patron=r'(\d+/\d+)').match:
|
||||||
|
item.action = 'play'
|
||||||
|
itemlist.append(item)
|
||||||
|
else:
|
||||||
|
# VVVVID vars
|
||||||
|
vvvvid_host = 'https://www.vvvvid.it/vvvvid/ondemand/'
|
||||||
|
vvvvid_headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'}
|
||||||
|
|
||||||
if 'http' not in item.url:
|
# VVVVID session
|
||||||
if '//' in item.url[:2]:
|
current_session = requests.Session()
|
||||||
item.url = 'http:' + item.url
|
login_page = 'https://www.vvvvid.it/user/login'
|
||||||
elif host not in item.url:
|
conn_id = current_session.get(login_page, headers=vvvvid_headers).json()['data']['conn_id']
|
||||||
item.url = host + item.url
|
payload = {'conn_id': conn_id}
|
||||||
|
|
||||||
|
|
||||||
|
# collect parameters
|
||||||
|
show_id = support.match(item.url, string=True, patron=r'(\d+)').match
|
||||||
|
ep_number = support.match(item.title, patron=r'(\d+)').match
|
||||||
|
json_file = current_session.get(vvvvid_host + show_id + '/seasons/', headers=vvvvid_headers, params=payload).json()
|
||||||
|
season_id = str(json_file['data'][0]['season_id'])
|
||||||
|
json_file = current_session.get(vvvvid_host + show_id + '/season/' + season_id +'/', headers=vvvvid_headers, params=payload).json()
|
||||||
|
|
||||||
|
# select the correct episode
|
||||||
|
for episode in json_file['data']:
|
||||||
|
support.log('Number',int(episode['number']),int(ep_number))
|
||||||
|
if int(episode['number']) == int(ep_number):
|
||||||
|
url = vvvvid_decoder.dec_ei(episode['embed_info'] or episode['embed_info'])
|
||||||
|
if 'youtube' in url: item.url = url
|
||||||
|
item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
||||||
|
if 'https' not in item.url:
|
||||||
|
url = support.match(item, url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')[1]
|
||||||
|
url = url.split()[-1]
|
||||||
|
itemlist.append(
|
||||||
|
support.Item(action= 'play',
|
||||||
|
url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url,
|
||||||
|
server= 'directo'))
|
||||||
|
|
||||||
|
elif 'adf.ly' in item.url:
|
||||||
|
from servers.decrypters import adfly
|
||||||
|
url = adfly.get_long_url(item.url)
|
||||||
|
|
||||||
if 'adf.ly' in item.url:
|
|
||||||
item.url = adfly.get_long_url(item.url)
|
|
||||||
elif 'bit.ly' in item.url:
|
elif 'bit.ly' in item.url:
|
||||||
item.url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||||
|
|
||||||
|
else:
|
||||||
|
url = host
|
||||||
|
for u in item.url.split('/'):
|
||||||
|
# support.log(i)
|
||||||
|
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:
|
||||||
|
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
|
||||||
|
|
||||||
matches = support.match(item, r'button"><a href="([^"]+)"')[0]
|
|
||||||
|
|
||||||
for video in matches:
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(channel=item.channel,
|
support.Item(channel=item.channel,
|
||||||
action="play",
|
action="play",
|
||||||
title='diretto',
|
title='Diretto',
|
||||||
url=video,
|
url=url,
|
||||||
server='directo'))
|
server='directo'))
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
data = support.match(item, headers=headers)[1]
|
data = support.match(item, headers=headers).data
|
||||||
if not any(x in data for x in ['Lista Episodi', 'Movie Parte']):
|
if not any(x in data for x in ['Lista Episodi', 'Movie Parte']):
|
||||||
support.log('NOT IN DATA')
|
support.log('NOT IN DATA')
|
||||||
patron = r'(?:iframe src|str)="(?P<url>[^"]+)"'
|
patron = r'(?:iframe src|str)="(?P<url>[^"]+)"'
|
||||||
@@ -107,7 +107,7 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
data = support.match(item, headers=headers)[1]
|
data = support.match(item, headers=headers).data
|
||||||
if 'Lista Episodi' not in data:
|
if 'Lista Episodi' not in data:
|
||||||
item.data = data
|
item.data = data
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
@@ -120,7 +120,7 @@ def findvideos(item):
|
|||||||
if item.data:
|
if item.data:
|
||||||
data = item.data
|
data = item.data
|
||||||
else:
|
else:
|
||||||
matches = support.match(item, '(?:str="([^"]+)"|iframe src="([^"]+)")')[0]
|
matches = support.match(item, patron=r'(?:str="([^"]+)"|iframe src="([^"]+)")').matches
|
||||||
data = ''
|
data = ''
|
||||||
if matches:
|
if matches:
|
||||||
for match in matches:
|
for match in matches:
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ __channel__ = "animesaturn"
|
|||||||
host = support.config.get_setting("channel_host", __channel__)
|
host = support.config.get_setting("channel_host", __channel__)
|
||||||
headers={'X-Requested-With': 'XMLHttpRequest'}
|
headers={'X-Requested-With': 'XMLHttpRequest'}
|
||||||
|
|
||||||
IDIOMAS = {'Italiano': 'ITA'}
|
|
||||||
list_language = IDIOMAS.values()
|
|
||||||
list_servers = ['openload', 'fembed', 'animeworld']
|
list_servers = ['openload', 'fembed', 'animeworld']
|
||||||
list_quality = ['default', '480p', '720p', '1080p']
|
list_quality = ['default', '480p', '720p', '1080p']
|
||||||
|
|
||||||
@@ -67,7 +66,7 @@ def peliculas(item):
|
|||||||
deflang= 'Sub-ITA'
|
deflang= 'Sub-ITA'
|
||||||
if item.args == 'updated':
|
if item.args == 'updated':
|
||||||
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
||||||
page, data = support.match(item, r'data-page="(\d+)" title="Next">', post=post, headers=headers)
|
page= support.match(item, patron=r'data-page="(\d+)" title="Next">', post=post, headers=headers).match
|
||||||
patron = r'<img alt="[^"]+" src="(?P<thumb>[^"]+)" [^>]+></div></a>\s*<a href="(?P<url>[^"]+)"><div class="testo">(?P<title>[^\(<]+)(?:(?P<lang>\(([^\)]+)\)))?</div></a>\s*<a href="[^"]+"><div class="testo2">[^\d]+(?P<episode>\d+)</div></a>'
|
patron = r'<img alt="[^"]+" src="(?P<thumb>[^"]+)" [^>]+></div></a>\s*<a href="(?P<url>[^"]+)"><div class="testo">(?P<title>[^\(<]+)(?:(?P<lang>\(([^\)]+)\)))?</div></a>\s*<a href="[^"]+"><div class="testo2">[^\d]+(?P<episode>\d+)</div></a>'
|
||||||
if page: nextpage = page
|
if page: nextpage = page
|
||||||
item.contentType='episode'
|
item.contentType='episode'
|
||||||
@@ -85,8 +84,8 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
movie, data = support.match(item, r'Episodi:</b> (\d*) Movie')
|
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
||||||
anime_id = support.match(data, r'anime_id=(\d+)')[0][0]
|
anime_id = support.match(movie.data, patron=r'anime_id=(\d+)').match
|
||||||
item.url = host + "/loading_anime?anime_id=" + anime_id
|
item.url = host + "/loading_anime?anime_id=" + anime_id
|
||||||
if movie:
|
if movie:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
@@ -108,9 +107,9 @@ def episodios(item):
|
|||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
urls = support.match(item, r'<a href="([^"]+)"><div class="downloadestreaming">', headers=headers)[0]
|
urls = support.match(item, patron=r'<a href="([^"]+)"><div class="downloadestreaming">', headers=headers, debug=True).matches
|
||||||
if urls:
|
if urls:
|
||||||
links = support.match(item, r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', url=urls[0], headers=headers)[0]
|
links = support.match(urls[0], patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers).matches
|
||||||
for link in links:
|
for link in links:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(channel=item.channel,
|
support.Item(channel=item.channel,
|
||||||
|
|||||||
+23
-29
@@ -34,7 +34,7 @@ def newest(categoria):
|
|||||||
|
|
||||||
if itemlist[-1].action == "ultimiep":
|
if itemlist[-1].action == "ultimiep":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua l'esecuzione in caso di errore
|
# Continua l'esecuzione in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
@@ -50,7 +50,7 @@ def search(item, texto):
|
|||||||
item.args = 'alt'
|
item.args = 'alt'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
@@ -67,10 +67,9 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
anime = True
|
anime = True
|
||||||
if item.args == 'updated':
|
if item.args == 'updated':
|
||||||
#patron = r'<div class="post-thumbnail">\s*<a href="(?P<url>[^"]+)" title="(?P<title>.*?)\s*(?P<episode>Episodio \d+)[^"]+"[^>]*>\s*<img[^src]+src="(?P<thumb>[^"]+)"'
|
|
||||||
patron = r'<div class="post-thumbnail">\s*<a href="(?P<url>[^"]+)" title="(?P<title>.*?)\s*Episodio (?P<episode>\d+) (?P<lang>[a-zA-Z-\s]+)[^"]*"> <img[^src]+src="(?P<thumb>[^"]+)"'
|
patron = r'<div class="post-thumbnail">\s*<a href="(?P<url>[^"]+)" title="(?P<title>.*?)\s*Episodio (?P<episode>\d+) (?P<lang>[a-zA-Z-\s]+)[^"]*"> <img[^src]+src="(?P<thumb>[^"]+)"'
|
||||||
patronNext = r'<link rel="next" href="([^"]+)"\s*/>'
|
patronNext = r'<link rel="next" href="([^"]+)"\s*/>'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
@@ -98,32 +97,27 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.args == 'updated':
|
if item.args == 'updated':
|
||||||
ep = support.match(item.fulltitle,r'(Episodio\s*\d+)')[0][0]
|
ep = support.match(item.fulltitle, patron=r'(\d+)').match
|
||||||
item.url = support.re.sub(r'episodio-\d+-|oav-\d+-', '',item.url)
|
item.url = support.re.sub(r'episodio-\d+-|oav-\d+-'+ep, '',item.url)
|
||||||
if 'streaming' not in item.url: item.url = item.url.replace('sub-ita','sub-ita-streaming')
|
if 'streaming' not in item.url: item.url = item.url.replace('sub-ita','sub-ita-streaming')
|
||||||
item.url = support.match(item, r'<a href="([^"]+)"[^>]+>', ep + '(.*?)</tr>', )[0][0]
|
item.url = support.match(item, patron= ep + r'[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
||||||
|
|
||||||
urls = support.match(item.url, r'(episodio\d*.php.*)')[0]
|
# post
|
||||||
for url in urls:
|
url = host + '/' + support.match(item.url, patron=r'(episodio\d*.php.*?)"').match.replace('%3F','?').replace('%3D','=')
|
||||||
url = host + '/' + url
|
headers['Referer'] = url
|
||||||
headers['Referer'] = url
|
cookies = ""
|
||||||
data = support.match(item, headers=headers, url=url)[1]
|
matches = support.re.compile('(.%s.*?)\n' % host.replace("http://", "").replace("www.", ""), support.re.DOTALL).findall(support.config.get_cookie_data())
|
||||||
cookies = ""
|
for cookie in matches:
|
||||||
matches = support.re.compile('(.%s.*?)\n' % host.replace("http://", "").replace("www.", ""), support.re.DOTALL).findall(support.config.get_cookie_data())
|
cookies += cookie.split('\t')[5] + "=" + cookie.split('\t')[6] + ";"
|
||||||
for cookie in matches:
|
headers['Cookie'] = cookies[:-1]
|
||||||
cookies += cookie.split('\t')[5] + "=" + cookie.split('\t')[6] + ";"
|
|
||||||
|
|
||||||
headers['Cookie'] = cookies[:-1]
|
url = support.match(url, patron=r'<source src="([^"]+)"[^>]+>').match
|
||||||
|
|
||||||
url = support.match(data, r'<source src="([^"]+)"[^>]+>')[0][0] + '|' + support.urllib.urlencode(headers)
|
|
||||||
itemlist.append(
|
|
||||||
support.Item(channel=item.channel,
|
|
||||||
action="play",
|
|
||||||
title='diretto',
|
|
||||||
quality='',
|
|
||||||
url=url,
|
|
||||||
server='directo',
|
|
||||||
fulltitle=item.fulltitle,
|
|
||||||
show=item.show))
|
|
||||||
|
|
||||||
return support.server(item,url,itemlist)
|
itemlist.append(
|
||||||
|
support.Item(channel=item.channel,
|
||||||
|
action="play",
|
||||||
|
title='Diretto',
|
||||||
|
url=url + '|' + support.urllib.urlencode(headers),
|
||||||
|
server='directo'))
|
||||||
|
|
||||||
|
return support.server(item,itemlist=itemlist)
|
||||||
@@ -98,11 +98,11 @@ def episodios(item):
|
|||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
if item.args == 'last':
|
if item.args == 'last':
|
||||||
match = support.match(item, r'href="(?P<url>[^"]+)"[^>]+><strong>DOWNLOAD & STREAMING</strong>', url=item.url)[0]
|
match = support.match(item, patron=r'href="(?P<url>[^"]+)"[^>]+><strong>DOWNLOAD & STREAMING</strong>').match
|
||||||
if match:
|
if match:
|
||||||
patronBlock = r'<h6>Episodio</h6>(?P<block>.*?)(?:<!--|</table>)'
|
patronBlock = r'<h6>Episodio</h6>(?P<block>.*?)(?:<!--|</table>)'
|
||||||
patron = r'<a href="http://link\.animetubeita\.com/2361078/(?P<url>[^"]+)"'
|
patron = r'<a href="http://link\.animetubeita\.com/2361078/(?P<url>[^"]+)"'
|
||||||
match = support.match(item, patron, patronBlock, headers, match[0])[0]
|
match = support.match(match, patron=patron, patronBlock=patronBlock, headers=headers).match
|
||||||
else: return itemlist
|
else: return itemlist
|
||||||
|
|
||||||
if match: item.url = match[-1]
|
if match: item.url = match[-1]
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ def mainlist(item):
|
|||||||
def genres(item):
|
def genres(item):
|
||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
matches = support.match(item, r'<input.*?name="([^"]+)" value="([^"]+)"\s*>[^>]+>([^<]+)<\/label>' , r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> Generi <span.[^>]+>(.*?)</ul>', headers=headers)[0]
|
matches = support.match(item, patron=r'<input.*?name="([^"]+)" value="([^"]+)"\s*>[^>]+>([^<]+)<\/label>' , patronBlock=r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> Generi <span.[^>]+>(.*?)</ul>', headers=headers).matches
|
||||||
for name, value, title in matches:
|
for name, value, title in matches:
|
||||||
support.menuItem(itemlist, __channel__, support.typo(title, 'bold'), 'peliculas', host + '/filter?' + name + '=' + value + '&sort=' + order(), 'tvshow', args='sub')
|
support.menuItem(itemlist, __channel__, support.typo(title, 'bold'), 'peliculas', host + '/filter?' + name + '=' + value + '&sort=' + order(), 'tvshow', args='sub')
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -44,7 +44,7 @@ def build_menu(item):
|
|||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
support.menuItem(itemlist, __channel__, 'Tutti bold', 'peliculas', item.url , 'tvshow' , args=item.args)
|
support.menuItem(itemlist, __channel__, 'Tutti bold', 'peliculas', item.url , 'tvshow' , args=item.args)
|
||||||
matches = support.match(item,r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> (.*?) <span.[^>]+>(.*?)</ul>',r'<form class="filters.*?>(.*?)</form>', headers=headers)[0]
|
matches = support.match(item, patron=r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> (.*?) <span.[^>]+>(.*?)</ul>', patronBlock=r'<form class="filters.*?>(.*?)</form>', headers=headers).matches
|
||||||
for title, html in matches:
|
for title, html in matches:
|
||||||
if title not in 'Lingua Ordine':
|
if title not in 'Lingua Ordine':
|
||||||
support.menuItem(itemlist, __channel__, title + ' submenu bold', 'build_sub_menu', html, 'tvshow', args=item.args)
|
support.menuItem(itemlist, __channel__, title + ' submenu bold', 'build_sub_menu', html, 'tvshow', args=item.args)
|
||||||
@@ -127,7 +127,7 @@ def peliculas(item):
|
|||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime=True
|
anime=True
|
||||||
pagination = 50
|
pagination = 50
|
||||||
data = support.match(item, headers=headers)[1]
|
data = support.match(item, headers=headers).data
|
||||||
if 'VVVVID' in data: patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)</ul>'
|
if 'VVVVID' in data: patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)</ul>'
|
||||||
else: patronBlock= r'server active(?P<block>.*?)server hidden '
|
else: patronBlock= r'server active(?P<block>.*?)server hidden '
|
||||||
patron = r'<li><a [^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+" href="(?P<url>[^"]+)"[^>]+>(?P<episode>[^<]+)<'
|
patron = r'<li><a [^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+" href="(?P<url>[^"]+)"[^>]+>(?P<episode>[^<]+)<'
|
||||||
@@ -143,9 +143,11 @@ def findvideos(item):
|
|||||||
import time
|
import time
|
||||||
support.log(item)
|
support.log(item)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
matches, data = support.match(item, r'class="tab.*?data-name="([0-9]+)">', headers=headers)
|
matches = support.match(item, patron=r'class="tab.*?data-name="([0-9]+)">', headers=headers)
|
||||||
|
data = matches.data
|
||||||
|
matches = matches.matches
|
||||||
videoData = ''
|
videoData = ''
|
||||||
|
|
||||||
for serverid in matches:
|
for serverid in matches:
|
||||||
if not item.number: item.number = support.scrapertools.find_single_match(item.title, r'(\d+) -')
|
if not item.number: item.number = support.scrapertools.find_single_match(item.title, r'(\d+) -')
|
||||||
block = support.scrapertools.find_multiple_matches(data, 'data-id="' + serverid + '">(.*?)<div class="server')
|
block = support.scrapertools.find_multiple_matches(data, 'data-id="' + serverid + '">(.*?)<div class="server')
|
||||||
@@ -153,7 +155,7 @@ def findvideos(item):
|
|||||||
support.log('ID= ',serverid)
|
support.log('ID= ',serverid)
|
||||||
if id:
|
if id:
|
||||||
if serverid == '26':
|
if serverid == '26':
|
||||||
matches = support.match(item, r'<a href="([^"]+)"', url='%s/ajax/episode/serverPlayer?id=%s' % (host, item.url.split('/')[-1]))[0]
|
matches = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, item.url.split('/')[-1]), patron=r'<a href="([^"]+)"', ).matches
|
||||||
for url in matches:
|
for url in matches:
|
||||||
videoData += '\n' + url
|
videoData += '\n' + url
|
||||||
else:
|
else:
|
||||||
@@ -162,7 +164,7 @@ def findvideos(item):
|
|||||||
json = jsontools.load(dataJson)
|
json = jsontools.load(dataJson)
|
||||||
support.log(json)
|
support.log(json)
|
||||||
if 'keepsetsu' in json['grabber']:
|
if 'keepsetsu' in json['grabber']:
|
||||||
matches = support.match(item, r'<iframe\s*src="([^"]+)"', url=json['grabber'])[0]
|
matches = support.match(json['grabber'], patron=r'<iframe\s*src="([^"]+)"'),matches
|
||||||
for url in matches:
|
for url in matches:
|
||||||
videoData += '\n' + url
|
videoData += '\n' + url
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
def select(item):
|
def select(item):
|
||||||
item.data = support.match(item)[1]
|
item.data = support.match(item).data
|
||||||
if 'continua con il video' in item.data.lower():
|
if 'continua con il video' in item.data.lower():
|
||||||
support.log('select = ### è un film ###')
|
support.log('select = ### è un film ###')
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
@@ -140,10 +140,10 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
if item.contentType != 'movie':
|
if item.contentType != 'movie':
|
||||||
links = support.match(item.url, r'href="([^"]+)"')[0]
|
links = support.match(item.url, patron=r'href="([^"]+)"').matches
|
||||||
else:
|
else:
|
||||||
matchData = item.data if item.data else item
|
matchData = item.data if item.data else item
|
||||||
links = support.match(matchData, r'(?:SRC|href)="([^"]+)"', patronBlock=r'<div class="col-md-10">(.+?)<div class="ads">')[0]
|
links = support.match(matchData, patron=r'(?:SRC|href)="([^"]+)"', patronBlock=r'<div class="col-md-10">(.+?)<div class="ads">').matches
|
||||||
data = ''
|
data = ''
|
||||||
from lib.unshortenit import unshorten_only
|
from lib.unshortenit import unshorten_only
|
||||||
for link in links:
|
for link in links:
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def peliculas(item):
|
|||||||
blacklist = Blacklist
|
blacklist = Blacklist
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
if item.args == 'newest':
|
if item.args == 'newest':
|
||||||
data = support.match(item)[1]
|
# data = support.match(item).data
|
||||||
patron = r'<div id="blockvids"><ul><li><a href="(?P<url>[^"]+)"[^>]+><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^\[]+)\[(?P<lang>[^\]]+)\]'
|
patron = r'<div id="blockvids"><ul><li><a href="(?P<url>[^"]+)"[^>]+><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^\[]+)\[(?P<lang>[^\]]+)\]'
|
||||||
else:
|
else:
|
||||||
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> <h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br />)?\s*(?P<plot>[^<]+)'
|
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> <h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br />)?\s*(?P<plot>[^<]+)'
|
||||||
@@ -68,7 +68,7 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
item.url = support.match(item,r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', r'Streaming:(.*?)</tr>')[0]
|
item.url = support.match(item, patron=r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', patronBlock=r'Streaming:(.*?)</tr>').matches
|
||||||
if 'Episodio' in str(item.url):
|
if 'Episodio' in str(item.url):
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return episodios(item)
|
return episodios(item)
|
||||||
@@ -87,14 +87,14 @@ def episodios(item):
|
|||||||
sp = 0
|
sp = 0
|
||||||
for match in item.url:
|
for match in item.url:
|
||||||
if 'stagione' in match.lower():
|
if 'stagione' in match.lower():
|
||||||
find_season = support.match(match, r'Stagione\s*(\d+)')[0]
|
find_season = support.match(match, patron=r'Stagione\s*(\d+)').match
|
||||||
season = int(find_season[0]) if find_season else season + 1 if 'prima' not in match.lower() else season
|
season = int(find_season) if find_season else season + 1 if 'prima' not in match.lower() else season
|
||||||
else:
|
else:
|
||||||
try: title = support.match(match,'<a[^>]+>([^<]+)</a>')[0][0]
|
try: title = support.match(match, patron=r'<a[^>]+>([^<]+)</a>').match
|
||||||
except: title = ''
|
except: title = ''
|
||||||
if title:
|
if title:
|
||||||
if 'episodio' in title.lower():
|
if 'episodio' in title.lower():
|
||||||
ep = support.match(match, r'Episodio ((?:\d+.\d|\d+|\D+))')[0][0]
|
ep = support.match(match, patron=r'Episodio ((?:\d+.\d|\d+|\D+))').match
|
||||||
check = ep.isdigit()
|
check = ep.isdigit()
|
||||||
if check or '.' in ep:
|
if check or '.' in ep:
|
||||||
if '.' in ep:
|
if '.' in ep:
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ def findvideos(item):
|
|||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
matches = support.match(item, 'filename: "(.*?)"')[0]
|
matches = support.match(item, patron=r'filename: "(.*?)"').matches
|
||||||
|
|
||||||
for url in matches:
|
for url in matches:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
|
|||||||
+16
-9
@@ -31,10 +31,11 @@ def menu(item):
|
|||||||
action = 'peliculas'
|
action = 'peliculas'
|
||||||
|
|
||||||
patronBlock = r'<div class="filter-header"><b>%s</b>(?P<block>.*?)<div class="filter-box">' % item.args
|
patronBlock = r'<div class="filter-header"><b>%s</b>(?P<block>.*?)<div class="filter-box">' % item.args
|
||||||
patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<url>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>'
|
patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<other>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
for Type, ID in support.match(item.url, r'data-type="([^"]+)" data-id="([^"]+)"')[0]:
|
support.log(item.type)
|
||||||
|
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
|
||||||
item.url = host + '/search?' + Type + 'Y=' + ID
|
item.url = host + '/search?' + Type + 'Y=' + ID
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
@@ -110,28 +111,34 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
support.log()
|
support.log()
|
||||||
|
|
||||||
matches, data = support.match(item, r'<a href="([^"]+)"', r'<div style="white-space: (.*?)<div id="main-content"')
|
matches = support.match(item, patron=r'<a href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
|
||||||
|
|
||||||
if not matches:
|
if not matches.matches:
|
||||||
item.data = data
|
item.data = matches.data
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return episodios(item)
|
return episodios(item)
|
||||||
|
|
||||||
matches.sort()
|
# matches.matches.sort()
|
||||||
|
|
||||||
for url in matches:
|
for url in matches.matches:
|
||||||
lang = url.split('/')[-2]
|
lang = url.split('/')[-2]
|
||||||
|
if 'ita' in lang.lower():
|
||||||
|
language = 'ITA'
|
||||||
|
if 'sub' in lang.lower():
|
||||||
|
language = 'Sub-' + language
|
||||||
quality = url.split('/')[-1]
|
quality = url.split('/')[-1]
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(channel=item.channel,
|
support.Item(channel=item.channel,
|
||||||
action="play",
|
action="play",
|
||||||
contentType=item.contentType,
|
contentType=item.contentType,
|
||||||
title=lang,
|
title=language,
|
||||||
url=url,
|
url=url,
|
||||||
contentLanguage = lang,
|
contentLanguage = language,
|
||||||
quality = quality,
|
quality = quality,
|
||||||
|
order = quality.replace('p','').zfill(4),
|
||||||
server='directo',
|
server='directo',
|
||||||
))
|
))
|
||||||
|
|
||||||
|
itemlist.sort(key=lambda x: (x.title, x.order), reverse=False)
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
@@ -145,7 +145,9 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
||||||
patron = r'<a href="([^"]+)">'
|
patron = r'<a href="([^"]+)">'
|
||||||
matches, data = support.match(item, patron, patronBlock, headers)
|
html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers)
|
||||||
|
matches = html.matches
|
||||||
|
data= html.data
|
||||||
|
|
||||||
if item.args != 'episodios':
|
if item.args != 'episodios':
|
||||||
item.infoLabels['mediatype'] = 'episode'
|
item.infoLabels['mediatype'] = 'episode'
|
||||||
@@ -156,7 +158,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
itemlist += support.server(item, data)
|
itemlist += support.server(item, data)
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = support.match(item.url).data
|
||||||
patron = r'>Posted in <a href="https?://fastsubita.com/serietv/([^/]+)/(?:[^"]+)?"'
|
patron = r'>Posted in <a href="https?://fastsubita.com/serietv/([^/]+)/(?:[^"]+)?"'
|
||||||
series = scrapertools.find_single_match(data, patron)
|
series = scrapertools.find_single_match(data, patron)
|
||||||
titles = support.typo(series.upper().replace('-', ' '), 'bold color kod')
|
titles = support.typo(series.upper().replace('-', ' '), 'bold color kod')
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ def findvideos(item):
|
|||||||
if item.contentType == 'episode':
|
if item.contentType == 'episode':
|
||||||
data = item.url
|
data = item.url
|
||||||
else:
|
else:
|
||||||
data = support.match(item)[1]
|
data = support.match(item).data
|
||||||
if 'link-episode' in data:
|
if 'link-episode' in data:
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodios(item)
|
||||||
|
|||||||
+3
-3
@@ -34,11 +34,11 @@ def peliculas(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
data =''
|
data =''
|
||||||
url = support.match(item, patronBlock=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">')[1]
|
url = support.match(item, patron=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">').match
|
||||||
seasons = support.match(item, r'<a href="([^"]+)">(\d+)<', r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers, url)[0]
|
seasons = support.match(url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers=headers).matches
|
||||||
for season_url, season in seasons:
|
for season_url, season in seasons:
|
||||||
season_url = support.urlparse.urljoin(url, season_url)
|
season_url = support.urlparse.urljoin(url, season_url)
|
||||||
episodes = support.match(item, r'<a href="([^"]+)">(\d+)<', '<h3>EPISODIO</h3><ul>(.*?)</ul>', headers, season_url)[0]
|
episodes = support.match(season_url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>', headers=headers).matches
|
||||||
for episode_url, episode in episodes:
|
for episode_url, episode in episodes:
|
||||||
episode_url = support.urlparse.urljoin(url, episode_url)
|
episode_url = support.urlparse.urljoin(url, episode_url)
|
||||||
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ def lista_serie(item):
|
|||||||
else:
|
else:
|
||||||
# Extrae las entradas
|
# Extrae las entradas
|
||||||
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
||||||
matches = support.match(item, patron, headers=headers)[0]
|
matches = support.match(item, patron=patron, headers=headers).matches
|
||||||
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
||||||
scrapedplot = ""
|
scrapedplot = ""
|
||||||
scrapedthumbnail = ""
|
scrapedthumbnail = ""
|
||||||
@@ -148,7 +148,9 @@ def episodios(item, itemlist=[]):
|
|||||||
patron += r'<p><a href="([^"]+)">'
|
patron += r'<p><a href="([^"]+)">'
|
||||||
|
|
||||||
|
|
||||||
matches, data = support.match(item, patron, headers=headers)
|
html = support.match(item, patron=patron, headers=headers)
|
||||||
|
matches = html.matches
|
||||||
|
data = html.data
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
for scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
||||||
scrapedplot = ""
|
scrapedplot = ""
|
||||||
@@ -224,7 +226,9 @@ def peliculas_tv(item):
|
|||||||
|
|
||||||
patron = '<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
|
patron = '<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
|
||||||
|
|
||||||
matches, data = support.match(item, patron, headers=headers)
|
html = support.match(item, patron=patron, headers=headers)
|
||||||
|
matches = html.matches
|
||||||
|
data = html.data
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
if scrapedtitle in ["FACEBOOK", "RAPIDGATOR", "WELCOME!"]:
|
if scrapedtitle in ["FACEBOOK", "RAPIDGATOR", "WELCOME!"]:
|
||||||
@@ -298,7 +302,7 @@ def search(item, texto):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
patron = '<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
patron = '<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
||||||
matches = support.match(item, patron, headers=headers)[0]
|
matches = support.match(item, patron=patron, headers=headers).matches
|
||||||
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
||||||
if texto.upper() in scrapedtitle.upper():
|
if texto.upper() in scrapedtitle.upper():
|
||||||
scrapedthumbnail = ""
|
scrapedthumbnail = ""
|
||||||
@@ -333,7 +337,7 @@ def list_az(item):
|
|||||||
|
|
||||||
alphabet = dict()
|
alphabet = dict()
|
||||||
patron = '<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
patron = '<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
||||||
matches = support.match(item, patron, headers=headers)[0]
|
matches = support.match(item, patron=patron, headers=headers).matches
|
||||||
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
for i, (scrapedurl, scrapedtitle) in enumerate(matches):
|
||||||
letter = scrapedtitle[0].upper()
|
letter = scrapedtitle[0].upper()
|
||||||
if letter not in alphabet:
|
if letter not in alphabet:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
seasons, data = support.match(item, r'<option value="(\d+)"[^>]*>\D+(\d+)')
|
seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches
|
||||||
patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">'
|
patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">'
|
||||||
patron = r'(?:<div class="list (?:active)?" data-id="(?P<season>\d+)">[^>]+>)?\s*<a data-id="(?P<episode>\d+)(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<url>[^>]+)>[^>]+>[^>]+>(?P<title>.+?)(?:\sSub-ITA)?<'
|
patron = r'(?:<div class="list (?:active)?" data-id="(?P<season>\d+)">[^>]+>)?\s*<a data-id="(?P<episode>\d+)(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<url>[^>]+)>[^>]+>[^>]+>(?P<title>.+?)(?:\sSub-ITA)?<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
|
|||||||
@@ -149,15 +149,15 @@ def findvideos(item):
|
|||||||
id = item.args['id']
|
id = item.args['id']
|
||||||
season = str(item.args['season'])
|
season = str(item.args['season'])
|
||||||
episode = str(item.args['episode'])
|
episode = str(item.args['episode'])
|
||||||
res = support.match(item, 'src="([^"]+)"[^>]*></video>', url=url, headers=[['Referer', domain]])
|
res = support.match(url, patron='src="([^"]+)"[^>]*></video>', headers=[['Referer', domain]]).match
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if res[0]:
|
if res:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="play",
|
action="play",
|
||||||
title='contentful',
|
title='contentful',
|
||||||
url=res[0][0],
|
url=res,
|
||||||
server='directo',
|
server='directo',
|
||||||
fulltitle=item.fulltitle,
|
fulltitle=item.fulltitle,
|
||||||
thumbnail=item.thumbnail,
|
thumbnail=item.thumbnail,
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ def anime(item):
|
|||||||
log()
|
log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
seasons = support.match(item, r'<div class="sp-body[^"]+">(.*?)<\/div>')[0]
|
seasons = support.match(item, patron=r'<div class="sp-body[^"]+">(.*?)<\/div>').matches
|
||||||
for season in seasons:
|
for season in seasons:
|
||||||
episodes = scrapertools.find_multiple_matches(season, r'<a.*?href="([^"]+)"[^>]+>([^<]+)<\/a>(.*?)<(:?br|\/p)')
|
episodes = scrapertools.find_multiple_matches(season, r'<a.*?href="([^"]+)"[^>]+>([^<]+)<\/a>(.*?)<(:?br|\/p)')
|
||||||
for url, title, urls, none in episodes:
|
for url, title, urls, none in episodes:
|
||||||
@@ -208,7 +208,7 @@ def newest(categoria):
|
|||||||
item = Item()
|
item = Item()
|
||||||
item.url = host +'/aggiornamenti/'
|
item.url = host +'/aggiornamenti/'
|
||||||
|
|
||||||
matches = support.match(item, r'mediaWrapAlt recomended_videos"[^>]+>\s*<a href="([^"]+)" title="([^"]+)" rel="bookmark">\s*<img[^s]+src="([^"]+)"[^>]+>')[0]
|
matches = support.match(item, patron=r'mediaWrapAlt recomended_videos"[^>]+>\s*<a href="([^"]+)" title="([^"]+)" rel="bookmark">\s*<img[^s]+src="([^"]+)"[^>]+>').matches
|
||||||
|
|
||||||
for url, title, thumb in matches:
|
for url, title, thumb in matches:
|
||||||
title = scrapertools.decodeHtmlentities(title).replace("Permalink to ", "").replace("streaming", "")
|
title = scrapertools.decodeHtmlentities(title).replace("Permalink to ", "").replace("streaming", "")
|
||||||
@@ -236,11 +236,11 @@ def findvideos(item):
|
|||||||
## data = item.url
|
## data = item.url
|
||||||
## else:
|
## else:
|
||||||
## data = httptools.downloadpage(item.url, headers=headers).data
|
## data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
|
|
||||||
data = re.sub('\n|\t', ' ', data)
|
data = re.sub('\n|\t', ' ', data)
|
||||||
data = re.sub(r'>\s+<', '> <', data)
|
data = re.sub(r'>\s+<', '> <', data)
|
||||||
check = scrapertools.find_single_match(data, r'<div class="category-film">\s+<h3>\s+(.*?)\s+</h3>\s+</div>')
|
check = support.match(data, patron=r'<div class="category-film">\s+<h3>\s+(.*?)\s+</h3>\s+</div>').match
|
||||||
if 'sub' in check.lower():
|
if 'sub' in check.lower():
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
support.log("CHECK : ", check)
|
support.log("CHECK : ", check)
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ def peliculas(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime = True
|
anime = True
|
||||||
data = support.match(item, headers=headers)[1]
|
data = support.match(item, headers=headers).data
|
||||||
if 'https://vcrypt.net' in data:
|
if 'https://vcrypt.net' in data:
|
||||||
patron = r'(?:<br /> |<p>)(?P<title>[^<]+)<a href="(?P<url>[^"]+)"'
|
patron = r'(?:<br /> |<p>)(?P<title>[^<]+)<a href="(?P<url>[^"]+)"'
|
||||||
else:
|
else:
|
||||||
|
|||||||
+3
-3
@@ -131,7 +131,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
elif '=' in item.args:
|
elif '=' in item.args:
|
||||||
json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json()
|
json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json()
|
||||||
Filter = support.match(item.args,r'\?([^=]+)=')[0][0]
|
Filter = support.match(item.args, patron=r'\?([^=]+)=').match
|
||||||
keys = [i[Filter] for i in json_file['data'] if Filter in i][0]
|
keys = [i[Filter] for i in json_file['data'] if Filter in i][0]
|
||||||
for key in keys:
|
for key in keys:
|
||||||
if key not in ['1','2']:
|
if key not in ['1','2']:
|
||||||
@@ -162,7 +162,7 @@ def episodios(item):
|
|||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
for key in episode:
|
for key in episode:
|
||||||
if 'stagione' in key['title'].encode('utf8').lower():
|
if 'stagione' in key['title'].encode('utf8').lower():
|
||||||
match = support.match(key['title'].encode('utf8'), r'[Ss]tagione\s*(\d+) - [Ee]pisodio\s*(\d+)')[0][0]
|
match = support.match(key['title'].encode('utf8'), patron=r'[Ss]tagione\s*(\d+) - [Ee]pisodio\s*(\d+)').match
|
||||||
title = match[0]+'x'+match[1] + ' - ' + item.fulltitle
|
title = match[0]+'x'+match[1] + ' - ' + item.fulltitle
|
||||||
make_item = True
|
make_item = True
|
||||||
elif int(key['season_id']) == int(season_id):
|
elif int(key['season_id']) == int(season_id):
|
||||||
@@ -206,7 +206,7 @@ def findvideos(item):
|
|||||||
if 'youtube' in url: item.url = url
|
if 'youtube' in url: item.url = url
|
||||||
item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
||||||
if 'https' not in item.url:
|
if 'https' not in item.url:
|
||||||
url = support.match(item, url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')[1]
|
url = support.match('https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')
|
||||||
url = url.split()[-1]
|
url = url.split()[-1]
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(action= 'play',
|
Item(action= 'play',
|
||||||
|
|||||||
+79
-18
@@ -180,7 +180,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
if debug:
|
if debug:
|
||||||
regexDbg(item, patron, headers, block)
|
regexDbg(item, patron, headers, block)
|
||||||
|
|
||||||
known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang', 'other']
|
||||||
# Legenda known_keys per i groups nei patron
|
# Legenda known_keys per i groups nei patron
|
||||||
# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality',
|
# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality',
|
||||||
# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
||||||
@@ -301,7 +301,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
contentTitle= scraped['title'] if item.contentType or CT == 'movie' else '',
|
contentTitle= scraped['title'] if item.contentType or CT == 'movie' else '',
|
||||||
contentLanguage = lang1,
|
contentLanguage = lang1,
|
||||||
contentEpisodeNumber=episode if episode else '',
|
contentEpisodeNumber=episode if episode else '',
|
||||||
news= item.news if item.news else ''
|
news= item.news if item.news else '',
|
||||||
|
other = scraped['other'] if scraped['other'] else ''
|
||||||
)
|
)
|
||||||
|
|
||||||
for lg in list(set(listGroups).difference(known_keys)):
|
for lg in list(set(listGroups).difference(known_keys)):
|
||||||
@@ -445,7 +446,7 @@ def scrape(func):
|
|||||||
if anime:
|
if anime:
|
||||||
if function == 'episodios' or item.action == 'episodios': autorenumber.renumber(itemlist, item, 'bold')
|
if function == 'episodios' or item.action == 'episodios': autorenumber.renumber(itemlist, item, 'bold')
|
||||||
else: autorenumber.renumber(itemlist)
|
else: autorenumber.renumber(itemlist)
|
||||||
if anime and autorenumber.check(item) == False and not scrapertools.find_single_match(itemlist[0].title, r'(\d+.\d+)'):
|
if anime and autorenumber.check(item) == False and len(itemlist)>0 and not scrapertools.find_single_match(itemlist[0].title, r'(\d+.\d+)'):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
|
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
|
||||||
@@ -772,31 +773,91 @@ def typo(string, typography=''):
|
|||||||
return string
|
return string
|
||||||
|
|
||||||
|
|
||||||
def match(item, patron='', patronBlock='', headers='', url='', post=''):
|
def match(item_url_string, **args):
|
||||||
|
'''
|
||||||
|
match is a function that combines httptools and scraper tools:
|
||||||
|
'''
|
||||||
|
log(item_url_string)
|
||||||
|
|
||||||
matches = []
|
matches = []
|
||||||
if type(item) == str:
|
url = None
|
||||||
data = item
|
# arguments allowed for scrape
|
||||||
|
patron = args.get('patron', None)
|
||||||
|
patronBlock = args.get('patronBlock', None)
|
||||||
|
patronBlocks = args.get('patronBlock', None)
|
||||||
|
debug = args.get('debug', False)
|
||||||
|
debugBlock = args.get('debugBlock', False)
|
||||||
|
string = args.get('string', False)
|
||||||
|
# remove scrape arguments
|
||||||
|
args = dict([(key, val) for key, val in args.items() if key not in ['patron', 'patronBlock', 'patronBlocks', 'debug', 'debugBlock', 'string']])
|
||||||
|
# dbg()
|
||||||
|
# check type of item_url_string
|
||||||
|
if type(item_url_string) == str:
|
||||||
|
if item_url_string.startswith('http') and not string: url = item_url_string
|
||||||
|
else : data = item_url_string
|
||||||
else:
|
else:
|
||||||
url = url if url else item.url
|
# if item_url_string is an item use item.url as url
|
||||||
if post:
|
url = item_url_string.url
|
||||||
data = httptools.downloadpage(url, headers=headers, ignore_response_code=True, post=post).data.replace("'", '"')
|
|
||||||
else:
|
# if there is a url, download the page
|
||||||
data = httptools.downloadpage(url, headers=headers, ignore_response_code=True).data.replace("'", '"')
|
if url:
|
||||||
|
if args.get('ignore_response_code', None) is None:
|
||||||
|
args['ignore_response_code'] = True
|
||||||
|
data = httptools.downloadpage(url, **args).data.replace("'", '"')
|
||||||
|
|
||||||
|
# format page data
|
||||||
data = re.sub(r'\n|\t', ' ', data)
|
data = re.sub(r'\n|\t', ' ', data)
|
||||||
data = re.sub(r'>\s\s*<', '><', data)
|
data = re.sub(r'>\s\s*<', '><', data)
|
||||||
log('DATA= ', data)
|
|
||||||
|
|
||||||
|
# collect blocks of a page
|
||||||
if patronBlock:
|
if patronBlock:
|
||||||
block = scrapertools.find_single_match(data, patronBlock)
|
blocks = [scrapertools.find_single_match(data, patronBlock)]
|
||||||
log('BLOCK= ',block)
|
elif patronBlocks:
|
||||||
|
blocks = scrapertools.find_multiple_matches(data, patronBlock)
|
||||||
else:
|
else:
|
||||||
block = data
|
blocks = [data]
|
||||||
|
|
||||||
|
# match
|
||||||
if patron:
|
if patron:
|
||||||
matches = scrapertools.find_multiple_matches(block, patron)
|
if type(patron) == str: patron = [patron]
|
||||||
log('MATCHES= ',matches)
|
for b in blocks:
|
||||||
|
for p in patron:
|
||||||
|
matches += scrapertools.find_multiple_matches(b, p)
|
||||||
|
|
||||||
return matches, block
|
# debug mode
|
||||||
|
if config.dev_mode():
|
||||||
|
if debugBlock:
|
||||||
|
match_dbg(data, patronBlock)
|
||||||
|
if debug:
|
||||||
|
for block in blocks:
|
||||||
|
for p in patron:
|
||||||
|
match_dbg(block, p)
|
||||||
|
|
||||||
|
# create a item
|
||||||
|
item = Item(data=data,
|
||||||
|
blocks=blocks,
|
||||||
|
block=blocks[0] if len(blocks) > 0 else '',
|
||||||
|
matches=matches,
|
||||||
|
match=matches[0] if len(matches) > 0 else '')
|
||||||
|
|
||||||
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
def match_dbg(data, patron):
|
||||||
|
import json, urllib2, webbrowser
|
||||||
|
url = 'https://regex101.com'
|
||||||
|
headers = {'content-type': 'application/json'}
|
||||||
|
data = {
|
||||||
|
'regex': patron,
|
||||||
|
'flags': 'gm',
|
||||||
|
'testString': data,
|
||||||
|
'delimiter': '"""',
|
||||||
|
'flavor': 'python'
|
||||||
|
}
|
||||||
|
r = urllib2.Request(url + '/api/regex', json.dumps(data, encoding='latin1'), headers=headers)
|
||||||
|
r = urllib2.urlopen(r).read()
|
||||||
|
permaLink = json.loads(r)['permalinkFragment']
|
||||||
|
webbrowser.open(url + "/r/" + permaLink)
|
||||||
|
|
||||||
|
|
||||||
def download(itemlist, item, typography='', function_level=1, function=''):
|
def download(itemlist, item, typography='', function_level=1, function=''):
|
||||||
|
|||||||
@@ -547,11 +547,9 @@ def episodios(item):
|
|||||||
if pagination and i >= pag * pagination: break # pagination
|
if pagination and i >= pag * pagination: break # pagination
|
||||||
match = []
|
match = []
|
||||||
if episode.has_key('number'):
|
if episode.has_key('number'):
|
||||||
match = support.match(episode['number'], r'(?P<season>\d+)x(?P<episode>\d+)')[0]
|
match = support.match(episode['number'], patron=r'(?P<season>\d+)x(?P<episode>\d+)').match
|
||||||
if match:
|
|
||||||
match = match[0]
|
|
||||||
if not match and episode.has_key('title'):
|
if not match and episode.has_key('title'):
|
||||||
match = support.match(episode['title'], r'(?P<season>\d+)x(?P<episode>\d+)')[0]
|
match = support.match(episode['title'], patron=r'(?P<season>\d+)x(?P<episode>\d+)').match
|
||||||
if match: match = match[0]
|
if match: match = match[0]
|
||||||
if match:
|
if match:
|
||||||
episode_number = match[1]
|
episode_number = match[1]
|
||||||
@@ -561,7 +559,7 @@ def episodios(item):
|
|||||||
season_number = episode['season'] if episode.has_key('season') else season if season else 1
|
season_number = episode['season'] if episode.has_key('season') else season if season else 1
|
||||||
episode_number = episode['number'] if episode.has_key('number') else ''
|
episode_number = episode['number'] if episode.has_key('number') else ''
|
||||||
if not episode_number.isdigit():
|
if not episode_number.isdigit():
|
||||||
episode_number = support.match(episode['title'], r'(?P<episode>\d+)')[0][0]
|
episode_number = support.match(episode['title'], patron=r'(?P<episode>\d+)').match
|
||||||
ep = int(episode_number) if episode_number else ep
|
ep = int(episode_number) if episode_number else ep
|
||||||
if not episode_number:
|
if not episode_number:
|
||||||
episode_number = str(ep).zfill(2)
|
episode_number = str(ep).zfill(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user