Fix CB01 Anime
This commit is contained in:
+50
-17
@@ -21,7 +21,8 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
anime = [('Genere',['','menu', '2']),
|
anime = [('Genere',['','menu', '2']),
|
||||||
('Per Lettera',['','menu', '1']),
|
('Per Lettera',['','menu', '1']),
|
||||||
('Per Anno',['','menu', '3'])]
|
('Per Anno',['','menu', '3']),
|
||||||
|
('Ultimi Anime Aggiornati',['','peliculas', 'newest'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@@ -39,13 +40,34 @@ def search(item, texto):
|
|||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
|
|
||||||
|
def newest(categoria):
|
||||||
|
support.log(categoria)
|
||||||
|
itemlist = []
|
||||||
|
item = support.Item()
|
||||||
|
try:
|
||||||
|
if categoria == "anime":
|
||||||
|
item.url = host
|
||||||
|
item.args = 'newest'
|
||||||
|
itemlist = peliculas(item)
|
||||||
|
# Continua la ricerca in caso di errore
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
support.logger.error("{0}".format(line))
|
||||||
|
return []
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
blacklist = Blacklist
|
blacklist = Blacklist
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
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>[^<]+)'
|
if item.args == 'newest':
|
||||||
patronNext = r'<link rel="next" href="([^"]+)"'
|
data = support.match(item)[1]
|
||||||
|
patron = r'<div id="blockvids"><ul><li><a href="(?P<url>[^"]+)"[^>]+><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^\[]+)\[(?P<lang>[^\]]+)\]'
|
||||||
|
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>[^<]+)'
|
||||||
|
patronNext = r'<link rel="next" href="([^"]+)"'
|
||||||
action = 'check'
|
action = 'check'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -72,20 +94,31 @@ def episodios(item):
|
|||||||
find_season = support.match(match, r'Stagione\s*(\d+)')[0]
|
find_season = support.match(match, r'Stagione\s*(\d+)')[0]
|
||||||
season = int(find_season[0]) if find_season else season + 1 if 'prima' not in match.lower() else season
|
season = int(find_season[0]) if find_season else season + 1 if 'prima' not in match.lower() else season
|
||||||
else:
|
else:
|
||||||
title = support.match(match,'<a[^>]+>([^<]+)</a>')[0][0]
|
try: title = support.match(match,'<a[^>]+>([^<]+)</a>')[0][0]
|
||||||
if 'episodio' in title.lower():
|
except: title = ''
|
||||||
ep = support.match(match, r'Episodio ((?:\d+.\d|\d+))')[0][0]
|
if title:
|
||||||
if '.' in ep:
|
if 'episodio' in title.lower():
|
||||||
sp += 1
|
ep = support.match(match, r'Episodio ((?:\d+.\d|\d+|\D+))')[0][0]
|
||||||
title = '0' + 'x' + str(sp).zfill(2) + ' - ' + title
|
check = ep.isdigit()
|
||||||
else:
|
if check or '.' in ep:
|
||||||
ep = int(ep)
|
if '.' in ep:
|
||||||
if season > s and ep > 1:
|
sp += 1
|
||||||
s += 1
|
title = '0' + 'x' + str(sp).zfill(2) + ' - ' + title
|
||||||
e = ep - 1
|
else:
|
||||||
title = str(season) + 'x' + str(ep-e).zfill(2) + ' - ' + title
|
ep = int(ep)
|
||||||
data += title + '|' + match + '\n'
|
if season > s and ep > 1:
|
||||||
|
s += 1
|
||||||
|
e = ep - 1
|
||||||
|
title = str(season) + 'x' + str(ep-e).zfill(2) + ' - ' + title
|
||||||
|
data += title + '|' + match + '\n'
|
||||||
|
else:
|
||||||
|
title += ' #movie'
|
||||||
|
data += title + '|' + match + '\n'
|
||||||
|
def itemHook(item):
|
||||||
|
if '#movie' in item.title:
|
||||||
|
item.contentType='movie'
|
||||||
|
item.title = item.title.replace(' #movie','')
|
||||||
|
return item
|
||||||
|
|
||||||
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
|
|||||||
Reference in New Issue
Block a user