Fix AnimeSaturn
This commit is contained in:
+45
-39
@@ -1,13 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per AnimeSaturn
|
# Canale per AnimeSaturn
|
||||||
# Thanks to 4l3x87
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
|
||||||
# __channel__ = "animesaturn"
|
|
||||||
# host = support.config.get_setting("channel_host", __channel__)
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers={'X-Requested-With': 'XMLHttpRequest'}
|
headers={'X-Requested-With': 'XMLHttpRequest'}
|
||||||
|
|
||||||
@@ -31,11 +28,8 @@ def search(item, texto):
|
|||||||
search = texto
|
search = texto
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
anime = True
|
anime = True
|
||||||
patron = r'href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<|(]+)(?:(?P<lang>\(([^\)]+)\)))?<|\)'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+> <span>(?P<title>[^<\(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?'
|
||||||
action = 'check'
|
action = 'check'
|
||||||
def itemHook(item):
|
|
||||||
item.url = item.url.replace('www.','')
|
|
||||||
return item
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@@ -59,37 +53,52 @@ def newest(categoria):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
patronMenu = r'u>(?P<title>[^<]+)<u>(?P<url>.*?)</div> </div>'
|
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<url>.*?)(?:"lista-top"|"clearfix")'
|
||||||
action = 'peliculas'
|
action = 'peliculas'
|
||||||
def itemHook(item):
|
item.args = 'top'
|
||||||
item.url = item.url.replace('www.','')
|
|
||||||
return item
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
anime = True
|
anime = True
|
||||||
|
|
||||||
deflang= 'Sub-ITA'
|
deflang= 'Sub-ITA'
|
||||||
if item.args == 'updated':
|
action = 'check'
|
||||||
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
|
||||||
page= support.match(item, patron=r'data-page="(\d+)" title="Next">', post=post, headers=headers).match
|
page = None
|
||||||
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>'
|
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
||||||
if page: nextpage = page
|
|
||||||
item.contentType='episode'
|
if item.args == 'top':
|
||||||
action = 'findvideos'
|
data=item.url
|
||||||
elif item.args == 'top':
|
patron = r'light">(?P<title2>[^<]+)</div>\s(?P<title>[^<]+)[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)">(?:<a[^>]+>|\s*)<img alt="[^"]+" src="(?P<thumb>[^"]+)"'
|
||||||
data = item.url
|
|
||||||
patron = r'<a href="(?P<url>[^"]+)">[^>]+>(?P<title>[^<\(]+)(?:\((?P<year>[0-9]+)\))?(?:\((?P<lang>[A-Za-z]+)\))?</div></a><div class="numero">(?P<title2>[^<]+)</div>.*?src="(?P<thumb>[^"]+)"'
|
|
||||||
action = 'check'
|
|
||||||
else:
|
else:
|
||||||
pagination = ''
|
data = support.match(item, post=post, headers=headers).data
|
||||||
if item.args == 'incorso': patron = r'"slider_title"\s*href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+>(?P<title>[^\(<]+)(?:\((?P<year>\d+)\))?</a>'
|
if item.args == 'updated':
|
||||||
else: patron = r'href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>.+?)(?:\((?P<lang>ITA)\))?(?:(?P<year>\((\d+)\)))?</span>'
|
page= support.match(data, patron=r'data-page="(\d+)" title="Next">').match
|
||||||
action = 'check'
|
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?"><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s\s*(?P<type>[^\s]+)\s*(?P<episode>\d+)'
|
||||||
def itemHook(item):
|
typeContentDict = {'Movie':'movie', 'Episodio':'episode'} #item.contentType='episode'
|
||||||
item.url = item.url.replace('www.','')
|
action = 'findvideos'
|
||||||
return item
|
def itemlistHook(itemlist):
|
||||||
|
if page:
|
||||||
|
itemlist.append(
|
||||||
|
support.Item(channel=item.channel,
|
||||||
|
action = item.action,
|
||||||
|
contentType=item.contentType,
|
||||||
|
title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),
|
||||||
|
url=item.url,
|
||||||
|
page= page,
|
||||||
|
args=item.args,
|
||||||
|
thumbnail=support.thumb()))
|
||||||
|
return itemlist
|
||||||
|
else:
|
||||||
|
pagination = ''
|
||||||
|
if item.args == 'incorso':
|
||||||
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-za-z-]+)\))?</a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<'
|
||||||
|
else:
|
||||||
|
patron = r'href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>.+?)(?:\((?P<lang>ITA)\))?(?:(?P<year>\((\d+)\)))?</span>'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@@ -110,21 +119,18 @@ def check(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
if item.contentType != 'movie': anime = True
|
if item.contentType != 'movie': anime = True
|
||||||
patron = r'<strong" style="[^"]+">(?P<title>[^<]+)</b></strong></td>\s*<td style="[^"]+"><a href="(?P<url>[^"]+)"'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
||||||
def itemHook(item):
|
|
||||||
item.url = item.url.replace('www.','')
|
|
||||||
return item
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# support.dbg()
|
url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G', headers=headers, debug=False).match
|
||||||
urls = support.match(item, patron=r'<a href="([^"]+)"><div class="downloadestreaming">', headers=headers, debug=False).matches
|
support.log(url)
|
||||||
if urls:
|
if url:
|
||||||
links = support.match(urls[0].replace('www.',''), patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers, debug=False)
|
links = support.match(url, patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers, debug=False).matches
|
||||||
for link in links.matches:
|
for link in links:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(channel=item.channel,
|
support.Item(channel=item.channel,
|
||||||
action="play",
|
action="play",
|
||||||
@@ -136,7 +142,7 @@ def findvideos(item):
|
|||||||
show=item.show,
|
show=item.show,
|
||||||
contentType=item.contentType,
|
contentType=item.contentType,
|
||||||
folder=False))
|
folder=False))
|
||||||
return support.server(item, links, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user