diff --git a/channels/animealtadefinizione.py b/channels/animealtadefinizione.py index 06e8fc68..740c3f7c 100644 --- a/channels/animealtadefinizione.py +++ b/channels/animealtadefinizione.py @@ -26,7 +26,7 @@ def mainlist(item): @support.scrape def menu(item): action = 'peliculas' - data = support.match(item, patron= r'' + item.args + r'').match + patronBlock= r'' + item.args + r'\s*' patronMenu = r'(?P[^<]+)<' return locals() diff --git a/channels/animeforce.py b/channels/animeforce.py index b1373656..6390ca90 100644 --- a/channels/animeforce.py +++ b/channels/animeforce.py @@ -27,7 +27,7 @@ def mainlist(item): def submenu(item): action = 'peliculas' patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select' - patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<t>[^&]+)[^\(]+\((?P<num>\d+)' + patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<t>[^(]+)[^\(]+\((?P<num>\d+)' def itemHook(item): item.url += host + '/anime/' + item.args + '/' + item.u item.title = support.typo(item.t, 'bold') @@ -54,10 +54,10 @@ def newest(categoria): return itemlist -def search(item, texto): - support.info(texto) - item.args = 'noorder' - item.url = host + '/?s=' + texto + '&cat=6010' +def search(item, text): + support.info('search',text) + item.search = text + item.url = host + '/lista-anime/' item.contentType = 'tvshow' try: return peliculas(item) @@ -71,6 +71,7 @@ def search(item, texto): @support.scrape def peliculas(item): + search = item.search anime = True if 'movie' in item.url: action = 'findvideos' diff --git a/channels/animeleggendari.py b/channels/animeleggendari.py index 6b430e59..10d032b9 100644 --- a/channels/animeleggendari.py +++ b/channels/animeleggendari.py @@ -59,7 +59,7 @@ def peliculas(item): anime = True blacklist = ['top 10 anime da vedere'] if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside' - patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)"> +<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+' + patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+' def itemHook(item): if 'movie' in item.title.lower(): item.title = support.re.sub(' - [Mm][Oo][Vv][Ii][Ee]|[Mm][Oo][Vv][Ii][Ee]','',item.title) diff --git a/channels/animesaturn.py b/channels/animesaturn.py index 14ad73a7..ee6d8f50 100644 --- a/channels/animesaturn.py +++ b/channels/animesaturn.py @@ -60,7 +60,7 @@ def newest(categoria): def submenu(item): data = support.match(item.url + item.args).data action = 'filter' - patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+><select id="(?P<parameter>[^"]+)"[^>]+>(?P<url>.*?)</select>' + patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<url>.*?)</select>' def itemlistHook(itemlist): itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas')) return itemlist[:-1] @@ -104,7 +104,7 @@ def peliculas(item): data = support.match(item, post=post, headers=headers).data if item.args == 'updated': page = support.match(data, patron=r'data-page="(\d+)" title="Next">').match - 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+)' + patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?">\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s\s*(?P<type>[^\s]+)\s*(?P<episode>\d+)' typeContentDict = {'Movie':'movie', 'Episodio':'episode'} #item.contentType='episode' action = 'findvideos' def itemlistHook(itemlist): @@ -113,7 +113,7 @@ def peliculas(item): return itemlist elif 'filter' in item.args: page = support.match(data, patron=r'totalPages:\s*(\d+)').match - patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?"><img src="(?P<thumb>[^"]+)"' + patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?">\s*<img src="(?P<thumb>[^"]+)"' def itemlistHook(itemlist): if item.nextpage: item.nextpage += 1 else: item.nextpage = 2 @@ -127,7 +127,7 @@ def peliculas(item): 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: # debug=True - patron = r'<img src="(?P<thumb>[^"]+)" alt="(?P<title>[^"\(]+)(?:\((?P<lang>[Ii][Tt][Aa])\))?(?:\s*\((?P<year>\d+)\))?[^"]*"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a class="[^"]+" href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+><p[^>]+>(?:(?P<plot>[^<]+))?<' + patron = r'<img src="(?P<thumb>[^"]+)" alt="(?P<title>[^"\(]+)(?:\((?P<lang>[Ii][Tt][Aa])\))?(?:\s*\((?P<year>\d+)\))?[^"]*"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a class="[^"]+" href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>\s*<p[^>]+>(?:(?P<plot>[^<]+))?<' return locals() diff --git a/channels/animeunity.py b/channels/animeunity.py index 064d834d..a434acea 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -187,7 +187,7 @@ def peliculas(item): itemlist.append(itm) - autorenumber.renumber(itemlist) + autorenumber.start(itemlist) if len(itemlist) >= 30: itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1)) @@ -212,7 +212,7 @@ def episodios(item): contentType='episode', url=it['link'])) - autorenumber.renumber(itemlist, item, 'bold') + autorenumber.start(itemlist, item) support.videolibrary(itemlist, item) support.download(itemlist, item) return itemlist diff --git a/channels/cb01anime.py b/channels/cb01anime.py index 10e0dc1a..d870e34e 100644 --- a/channels/cb01anime.py +++ b/channels/cb01anime.py @@ -90,6 +90,7 @@ def episodios(item): s = 1 e = 0 sp = 0 + for match in item.url: if 'stagione' in match.lower(): find_season = support.match(match, patron=r'Stagione\s*(\d+)').match @@ -111,17 +112,17 @@ def episodios(item): s += 1 e = ep - 1 title = str(season) + 'x' + str(ep-e).zfill(2) + ' - ' + title - data += title + '|' + match + '\n' + data += title + '|' + match + '\|' else: title += ' #movie' - data += title + '|' + match + '\n' + data += title + '|' + match + '\|' 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>[^\|]+)\|' action = 'findvideos' return locals() diff --git a/core/support.py b/core/support.py index 99c83171..cebac317 100755 --- a/core/support.py +++ b/core/support.py @@ -353,7 +353,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t AC = name break else: AC = action - if (scraped["title"] not in blacklist) and (search.lower() in longtitle.lower()): + + if (not scraped['title'] or scraped["title"] not in blacklist) and (search.lower() in longtitle.lower()): contentType = 'episode' if function == 'episodios' else CT if CT else item.contentType it = Item( channel=item.channel, @@ -391,7 +392,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t def html_uniform(data): - """ + """ replace all ' with " and eliminate newline, so we don't need to worry about """ return re.sub("='([^']+)'", '="\\1"', data.replace('\n', ' ').replace('\t', ' ').replace(' ', ' '))