From 2251d3030e96c32bdd2efdd15f4706be01bd3491 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 17 Mar 2021 12:18:57 +0100 Subject: [PATCH 1/4] - Fix Piratestreaming - Normalizzazione numerazione episodi --- channels/piratestreaming.py | 2 +- core/support.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/piratestreaming.py b/channels/piratestreaming.py index a4a95a5e..dba3d996 100644 --- a/channels/piratestreaming.py +++ b/channels/piratestreaming.py @@ -78,7 +78,7 @@ def episodios(item): if item.data: data = item.data # debug= True title = item.fulltitle - patron = r'link-episode">(?:\s*)?\s*(?P\d+.\d+(?:.\d+)?)(?:\s*\((?P[?PA-Za-z-]+)[^>]+>)?(?:\s*(?P.*?) )[^>]+<\/span>\s*(?P<url>.*?)</div>' + patron = r'link-episode">(?:\s*<strong>)?\s*(?P<episode>\d+.\d+(?:.\d+)?)(?:\s*\((?P<lang>[?P<lang>A-Za-z-]+)[^>]+>)?(?:\s*(?P<title>[^-<]+))[^>]+</span>\s*(?P<url>.*?)</div>' def itemHook(item): if 'Episodio' in item.title: item.title = support.re.sub(r'Episodio [0-9.-]+', title, item.title) diff --git a/core/support.py b/core/support.py index b243e539..a806e112 100755 --- a/core/support.py +++ b/core/support.py @@ -261,6 +261,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t infolabels['rating'] = scrapertools.decodeHtmlentities(scraped["rating"]) episode = '' + if not group or item.grouped: if scraped['season'] and scraped['episode']: stagione = scraped['season'] @@ -277,7 +278,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t elif item.season: infolabels['season'] = int(item.season) infolabels['episode'] = int(scrapertools.find_single_match(scraped['episode'], r'(\d+)')) - episode = item.season +'x'+ scraped['episode'] + episode = item.season +'x'+ scraped['episode'].zfill(2) elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''): item.news = 'season_completed' episode = '' From c2d12286658599e2df3829860fc69e88226704c2 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 17 Mar 2021 12:30:33 +0100 Subject: [PATCH 2/4] - Fix Nome file in Wstream - Migliorato riconoscimento m3u9 in download --- servers/wstream.py | 2 ++ specials/downloads.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/wstream.py b/servers/wstream.py index 83ce24f3..5e44cc47 100644 --- a/servers/wstream.py +++ b/servers/wstream.py @@ -80,6 +80,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= key['type'] = 'mp4' if not 'src' in key and 'file' in key: key['src'] = key['file'] + if '?' in key['src']: key['src'] = key['src'].split('?')[0] video_urls.append(['%s [%s]' % (key['type'].replace('video/', ''), key['label']), key['src'].replace('https', 'http') + '|' + _headers]) elif type(key) != dict: filetype = key.split('.')[-1] @@ -87,6 +88,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= video_urls.append([filetype, key.replace('https', 'http') + '|' + _headers]) else: if not 'src' in key and 'file' in key: key['src'] = key['file'] + if '?' in key['src']: key['src'] = key['src'].split('?')[0] if key['src'].split('.')[-1] == 'mpd': pass video_urls.append([key['src'].split('.')[-1], key['src'].replace('https', 'http') + '|' + _headers]) except: diff --git a/specials/downloads.py b/specials/downloads.py index fc6ec34f..6ff6b739 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -578,7 +578,7 @@ def sort_method(item): def download_from_url(url, item): info("Attempting to download:", url) - if url.lower().split('|')[0].endswith(".m3u8") or url.lower().startswith("rtmp"): + if '.m3u8' in url.lower().split('|')[0] or url.lower().startswith("rtmp"): save_server_statistics(item.server, 0, False) platformtools.dialog_notification('m3u8 Download',config.get_localized_string(60364), sound=False) return {"downloadStatus": STATUS_CODES.error} From 5f786c3eb4d90a0a8f9a2ca5796bf262d08c1956 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 17 Mar 2021 14:44:38 +0100 Subject: [PATCH 3/4] ITA come default in mancanza di tag. --- core/videolibrarytools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index 53af798f..0b0a28b5 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -327,8 +327,8 @@ def filter_list(episodelist, action=None, path=None): # Make Language List for episode in episodelist: + if not episode.contentLanguage: episode.contentLanguage = 'ITA' if type(episode.contentLanguage) == list and episode.contentLanguage not in lang_list: - #lang_list = episode.contentLanguage pass else: if episode.contentLanguage and episode.contentLanguage not in lang_list: @@ -338,6 +338,7 @@ def filter_list(episodelist, action=None, path=None): if sub not in sub_list: sub_list.append(sub) else: lang_list.append(episode.contentLanguage) + # add to Language List subtitled languages if sub_list: for sub in sub_list: From 8d5576099072f6402096e86b828ad4ff63db45eb Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Wed, 17 Mar 2021 15:28:36 +0100 Subject: [PATCH 4/4] Fix Autoplay --- core/autoplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/autoplay.py b/core/autoplay.py index 4f3c3dff..53a291de 100644 --- a/core/autoplay.py +++ b/core/autoplay.py @@ -284,6 +284,6 @@ def play_multi_channel(item, itemlist): def servername(server): from core.servertools import translate_server_name path = filetools.join(config.get_runtime_path(), 'servers', server.lower() + '.json') - name = jsontools.load(open(path, "r").read())['name'] + name = jsontools.load(open(path, "rb").read())['name'] if name.startswith('@'): name = config.get_localized_string(int(name.replace('@',''))) return translate_server_name(name) \ No newline at end of file