Fix Toonitalia
This commit is contained in:
+29
-14
@@ -3,7 +3,7 @@
|
|||||||
# Canale per ToonItalia
|
# Canale per ToonItalia
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import scrapertools, support
|
from core import httptools, scrapertools, support
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
@@ -90,24 +90,39 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime = True
|
@support.scrape
|
||||||
# debug = True
|
def findepisode(item):
|
||||||
patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)'
|
anime = True
|
||||||
# data = ''
|
actLike = 'episodios'
|
||||||
# match = support.match(item, headers=headers, patron=r'(?: /> |<p>)(?:(?P<season>\d+)×)?(?P<episode>\d+)(?:\s+–\s+)?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)').matches
|
patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)'
|
||||||
# if match:
|
return locals()
|
||||||
# for m in match:
|
|
||||||
# data += '{}{:02d}|{}|{}|'.format(m[0]+'x' if m[0] else '', int(m[1]), clean_title(m[2]), m[3])
|
|
||||||
#
|
|
||||||
# patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|'
|
|
||||||
|
|
||||||
return locals()
|
itemlist = findepisode(item)
|
||||||
|
if itemlist: return itemlist
|
||||||
|
else: return [item.clone(action='findvideos')]
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
return support.server(item, item.data if item.contentType != 'movie' else support.match(item.url, headers=headers).data )
|
servers = []
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
if item.data:
|
||||||
|
data = item.data
|
||||||
|
else:
|
||||||
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
|
|
||||||
|
matches =support.match(data, patron='href="([^"]+)[^>]+>([^<\d]+)(\d+p)?').matches
|
||||||
|
if matches:
|
||||||
|
for match in matches:
|
||||||
|
itemlist.append(item.clone(server=match[1].strip().lower(), quality=match[2], url=match[0]))
|
||||||
|
if itemlist:
|
||||||
|
servers = support.server(item, itemlist=itemlist)
|
||||||
|
else:
|
||||||
|
servvers = support.server(item, data=data)
|
||||||
|
return servers
|
||||||
|
|
||||||
|
# return support.server(item, item.data if item.contentType != 'movie' else support.match(item.url, headers=headers).data )
|
||||||
|
|
||||||
|
|
||||||
def clean_title(title):
|
def clean_title(title):
|
||||||
|
|||||||
+2
-2
@@ -211,7 +211,7 @@ def cleantitle(title):
|
|||||||
if type(title) != str: title.decode('UTF-8')
|
if type(title) != str: title.decode('UTF-8')
|
||||||
title = scrapertools.unescape(title)
|
title = scrapertools.unescape(title)
|
||||||
title = scrapertools.decodeHtmlentities(title)
|
title = scrapertools.decodeHtmlentities(title)
|
||||||
cleantitle = title.replace('"', "'").replace('×', 'x').replace('–', '-').strip()
|
cleantitle = title.replace('"', "'").replace('×', 'x').replace('–', '-').strip().strip('-').strip()
|
||||||
return cleantitle
|
return cleantitle
|
||||||
|
|
||||||
|
|
||||||
@@ -509,7 +509,7 @@ def scrape(func):
|
|||||||
# info('STACK= ',inspect.stack()[1][3])
|
# info('STACK= ',inspect.stack()[1][3])
|
||||||
item = args['item']
|
item = args['item']
|
||||||
|
|
||||||
action = args.get('action', 'findvideos')
|
action = args.get('action', 'episodios' if item.contentType == 'tvshow' and function != 'episodios' else 'findvideos')
|
||||||
anime = args.get('anime', '')
|
anime = args.get('anime', '')
|
||||||
addVideolibrary = args.get('addVideolibrary', True)
|
addVideolibrary = args.get('addVideolibrary', True)
|
||||||
search = args.get('search', '')
|
search = args.get('search', '')
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
bloque = scrapertools.find_single_match(data, "sources.*?\}")
|
bloque = scrapertools.find_single_match(data, "sources.*?\}")
|
||||||
video_srcs = scrapertools.find_multiple_matches(bloque, ': "([^"]+)')
|
video_srcs = scrapertools.find_multiple_matches(bloque, ': "([^"]+)')
|
||||||
for url in video_srcs:
|
for url in video_srcs:
|
||||||
video_urls.append([" [Voe]", url])
|
video_urls.append([url.split('.')[-1] + " [Voe]", url])
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user