diff --git a/channels/animeforce.py b/channels/animeforce.py index 08fad2be..26cc1d02 100644 --- a/channels/animeforce.py +++ b/channels/animeforce.py @@ -24,7 +24,6 @@ headers = [['Referer', host]] def mainlist(item): anime = ['/lista-anime/', ('In Corso',['/lista-anime-in-corso/']), - ('Ultimei Aggiornamenti',['','peliculas','newest']), ('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last']) ] return locals() @@ -61,16 +60,26 @@ def search(item, texto): @support.scrape def peliculas(item): anime = True + action = 'episodios' + if item.args == 'newest': - patron = r'src="(?P[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P.*?) Episodi[^"]+".*?<h2><a href="(?P<url>[^"]+)"' + patron = r'src="(?P<thumb>[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P<title>[^"]+").*?<h2><a href="(?P<url>[^"]+)"' + def itemHook(item): + item.url = support.match(item, '<a href="([^"]+)" class="btn', headers=headers)[0][0] + delete = support.scrapertoolsV2.find_single_match(item.fulltitle, r'( Episodi.*)') + number = support.scrapertoolsV2.find_single_match(item.title, r'Episodi(?:o)? (?:\d+รท)?(\d+)') + item.title = support.typo(number + ' - ','bold') + item.title.replace(delete,'') + item.fulltitle = item.show = item.title.replace(delete,'') + item.number = number + return item + action = 'findvideos' elif item.args == 'last': patron = r'src="(?P<thumb>[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P<title>.*?)(?: Sub| sub| SUB|").*?<h2><a href="(?P<url>[^"]+)"' else: pagination = '' - patron = '<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]' - action = 'episodios' + patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]' return locals() diff --git a/core/support.py b/core/support.py index e23cdd75..1748daf8 100644 --- a/core/support.py +++ b/core/support.py @@ -223,7 +223,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t if stagione: episode = season +'x'+ scraped['episode'] elif item.contentType == 'tvshow' and (scraped['episode'] == '' and season == ''): - item.args = 'season_completed' + item.news = 'season_completed' episode = '' else: episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else '' @@ -768,6 +768,7 @@ def match(item, patron='', patronBlock='', headers='', url='', post=''): if patron: matches = scrapertoolsV2.find_multiple_matches(block, patron) + if not matches: matches = [''] log('MATCHES= ',matches) return matches, block diff --git a/specials/news.py b/specials/news.py index 49b48ad9..b4d2e734 100644 --- a/specials/news.py +++ b/specials/news.py @@ -434,7 +434,7 @@ def get_title(item): if item.quality: title += support.typo(item.quality, '_ [] color kod') - season_ = support.typo(config.get_localized_string(70736), '_ [] color white bold') if (type(item.args) != bool and 'season_completed' in item.args) else '' + season_ = support.typo(config.get_localized_string(70736), '_ [] color white bold') if (type(item.args) != bool and 'season_completed' in item.news) else '' if season_: title += season_ return title