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/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 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 = '' 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: 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}