From bb4e63471ef13ccbaaec395527e0e8df4053ffba Mon Sep 17 00:00:00 2001 From: ilmich Date: Fri, 19 Jul 2024 19:01:17 +0200 Subject: [PATCH] channels: fix raiplay e filmpertutti --- channels/filmpertutti.json | 2 +- channels/filmpertutti.py | 29 +++++++++++++++++++---------- channels/raiplay.py | 4 ++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/channels/filmpertutti.json b/channels/filmpertutti.json index 0130b04a..2d32fc4a 100644 --- a/channels/filmpertutti.json +++ b/channels/filmpertutti.json @@ -5,6 +5,6 @@ "language": ["ita", "sub-ita"], "thumbnail": "filmpertutti.png", "banner": "filmpertutti.png", - "categories": ["tvshow","movie"], + "categories": ["anime", "tvshow","movie"], "settings": [] } diff --git a/channels/filmpertutti.py b/channels/filmpertutti.py index 79462801..ecda950d 100644 --- a/channels/filmpertutti.py +++ b/channels/filmpertutti.py @@ -15,18 +15,21 @@ def findhost(url): host = config.get_channel_url(findhost) headers = [['Referer', host]] - @support.menu def mainlist(item): film = ['/category/film/feed/', ('Film al cinema', ['/category/ora-al-cinema/feed/', 'peliculas']), ('Generi', ['/', 'genres']), - ('Saghe', ['/', 'genres', 'saghe']), + ('Saghe', ['/', 'genres', 'saghe']), ] tvshow = ['/category/serie-tv/feed/', ] + + anime = ['/category/anime/feed/', + ('SUB-ITA',['/category/anime-sub-ita/feed/', 'peliculas']), + ] search = '' return locals() @@ -42,7 +45,7 @@ def peliculas(item): if not item.parent_url: item.parent_url = item.url - + if item.args == 'genres': action = 'check' @@ -70,11 +73,17 @@ def episodios(item): for ep in support.match(block, patron=[r'
  • [^\"]+).*?img\" src=\"(?P[^\"]+).*?title\">(?P[0-9]+)\.\s+(?P.*?)</span>']).matches: itemlist.append(item.clone(contentType = 'episode', action='findvideos', - thumb = ep[1], + thumb=ep[1], + episode=ep[2], + season=it[1], + contentSeason=it[1], + contentEpisodeNumber=ep[2], title = support.format_longtitle(support.cleantitle(ep[3]), season = it[1], episode = ep[2], lang= it[3]), - url = ep[0], data = '') + url = scrapertools.unescape(ep[0]), data = '') ) + if config.get_setting('episode_info') and not support.stackCheck(['add_tvshow', 'get_newest']): + support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) support.check_trakt(itemlist) support.videolibrary(itemlist, item) if (config.get_setting('downloadenabled')): @@ -85,9 +94,9 @@ def episodios(item): @support.scrape def genres(item): action = 'peliculas' - item.args = 'genres' blacklist = ['Tutti i film',] wantSaga = True if item.args == 'saghe' else False + item.args = 'genres' patronBlock = r'<nav class="elementor-nav-menu--main (?P<block>.*?)</nav>' patronMenu = r'<li class="menu-item.*?<a href="(?P<url>https:\/\/.*?)".*?>(?P<title>.*?)</a></li>' @@ -95,7 +104,7 @@ def genres(item): def itemHook(item): item.url = "{}/feed/".format(item.url) return item - + def itemlistHook(itemlist): itl = [] for item in itemlist: @@ -162,10 +171,10 @@ def newest(categoria): def findvideos(item): video_url = item.url - + if item.contentType == 'movie': - video_url = support.match(item.url, patron=r'<a href="([^"]+)" rel="nofollow">').match - + video_url = support.match(item.url, patron=r'<a href="([^"]+)" rel="nofollow">').match + video_url = support.match(video_url, patron=r'<iframe src=\"(https://.*?)\"').match if (video_url == ''): diff --git a/channels/raiplay.py b/channels/raiplay.py index 08e5c3fb..b8cbe50b 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -280,6 +280,10 @@ def addinfo(items, item): item.forcethumb = True episode = 0 season = 0 + + if key.get('type','') == 'RaiPlay Link Item': + return '' + if key.get('titolo', ''): key = requests.get(getUrl(key['path_id'])).json()['program_info']