From 6702aac0c2a844c6f4cf7bbb18a327ae63ea0a20 Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 14:28:17 +0200 Subject: [PATCH 01/10] fix: scrapeLang setta contentLanguage a ITA --- core/support.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/support.py b/core/support.py index 91bcd973..144738d0 100644 --- a/core/support.py +++ b/core/support.py @@ -166,11 +166,10 @@ def scrapeLang(scraped, lang, longtitle): ## # nei siti dove la lingua è opzionale per il sub-ita e manca l'ita ## else: ## lang = 'ITA' -## if not language: language = lang -## if language: longtitle += typo(language, '_ [] color kod') +## if not language: language = lang +## if language: longtitle += typo(language, '_ [] color kod') - if not scraped['lang'] and not lang: - #pass + if not scraped['lang'] and lang == '': language = 'ITA' # setta contentLanguage elif not scraped['lang'] and lang: # in caso di deflang attiva @@ -241,6 +240,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t longtitle = typo(longtitle, 'bold') longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '') + lang, longtitle = scrapeLang(scraped, lang, longtitle) if lang == '': lang = 'ITA' # if title is set, probably this is a list of episodes or video sources From 60b6ccbca35d4c3235dcefe03ae90de1294398de Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 14:30:10 +0200 Subject: [PATCH 02/10] fix: speclials/news - standardizzati i risultati ai ko(d)lori --- specials/news.py | 54 ++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/specials/news.py b/specials/news.py index f088294b..bf42578d 100644 --- a/specials/news.py +++ b/specials/news.py @@ -12,7 +12,7 @@ from threading import Thread from channelselector import get_thumb, auto_filter from core import channeltools from core import jsontools -from core import scrapertools +from core import scrapertools, support from core.item import Item from platformcode import config, logger from platformcode import platformtools @@ -28,7 +28,7 @@ perfil = [['0xFF0B7B92', '0xFF89FDFB', '0xFFACD5D4'], ['0xFFA5DEE5', '0xFFE0F9B5', '0xFFFEFDCA'], ['0xFFF23557', '0xFF22B2DA', '0xFFF0D43A']] -color1, color2, color3 = ["white", "white", "white"] +color1, color2, color3 = ["red", "0xFF65B3DA", "yellow"] # color1, color2, color3 = perfil[__perfil__] list_newest = [] @@ -128,7 +128,7 @@ def get_channels_list(): ## list_canales = {'peliculas': [], '4k': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [], ## 'castellano': [], 'latino':[], 'italiano':[], 'torrent':[], 'documentales': []} list_canales = {'peliculas': [], 'series': [],'anime': [], 'italiano':[], 'documentales': []} - + any_active = False # Rellenar listas de canales disponibles channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') @@ -392,16 +392,17 @@ def get_newest(channel_id, categoria): def get_title(item): + support.log("ITEM NEWEST ->", item) if item.contentSerieName: # Si es una serie title = item.contentSerieName + #title = re.compile("\[.*?\]", re.DOTALL).sub("", item.contentSerieName) if not scrapertools.get_season_and_episode(title) and item.contentEpisodeNumber: if not item.contentSeason: item.contentSeason = '1' title = "%s - %sx%s" % (title, item.contentSeason, str(item.contentEpisodeNumber).zfill(2)) - #4l3x87 - fix to add Sub-ITA in newest - if item.contentLanguage: - title+=" "+item.contentLanguage - +## #4l3x87 - fix to add Sub-ITA in newest +## if item.contentLanguage: +## title+=" "+item.contentLanguage elif item.contentTitle: # Si es una pelicula con el canal adaptado title = item.contentTitle @@ -415,16 +416,25 @@ def get_title(item): title = re.compile("\[/*B\]", re.DOTALL).sub("", title) title = re.compile("\[/*I\]", re.DOTALL).sub("", title) + title = '[B]'+title+'[/B]' + if (type(item.contentLanguage) != list and 'ITA' not in item.contentLanguage) or item.contentLanguage != 'ITA': + title += support.typo(item.contentLanguage, '_ [] color kod') + if item.quality: + title += support.typo(item.quality, '_ [] color kod') return title def no_group(list_result_canal): itemlist = [] global channels_id_name + support.log("NO GROUP -> ", list_result_canal) for i in list_result_canal: - i.title = get_title(i) + " [" + channels_id_name[i.channel] + "]" - i.text_color = color3 + support.log("NO GROUP i -> ", i) + canale = channels_id_name[i.channel] + canale = '[COLOR yellow]'+canale+'[/COLOR]' + i.title = get_title(i) + " [" + canale + "]" +# i.text_color = color3 itemlist.append(i.clone()) @@ -449,12 +459,12 @@ def group_by_channel(list_result_canal): itemlist.append(Item(channel="news", title=channels_id_name[c] + ':', text_color=color1, text_bold=True)) for i in dict_canales[c]: - if i.contentQuality: - i.title += ' (%s)' % i.contentQuality - if i.language: - i.title += ' [%s]' % i.language - i.title = ' %s' % i.title - i.text_color = color3 +## if i.contentQuality: +## i.title += ' (%s)' % i.contentQuality +## if i.contentLanguage: +## i.title += ' [%s]' % i.contentLanguage +## i.title = ' %s' % i.title +#### i.text_color = color3 itemlist.append(i.clone()) return itemlist @@ -505,7 +515,7 @@ def group_by_content(list_result_canal): else: new_item = v[0].clone(title=title) - new_item.text_color = color3 +## new_item.text_color = color3 list_result.append(new_item) return sorted(list_result, key=lambda it: it.title.lower()) @@ -521,11 +531,11 @@ def show_channels(item): new_item = Item() new_item = new_item.fromurl(i) # logger.debug(new_item.tostring()) - if new_item.contentQuality: - new_item.title += ' (%s)' % new_item.contentQuality - if new_item.language: - new_item.title += ' [%s]' % new_item.language - new_item.title += ' (%s)' % channels_id_name[new_item.channel] +## if new_item.contentQuality: +## new_item.title += ' (%s)' % new_item.contentQuality +## if new_item.language: +## new_item.title += ' [%s]' % new_item.language +## new_item.title += ' (%s)' % channels_id_name[new_item.channel] new_item.text_color = color1 itemlist.append(new_item.clone()) @@ -583,7 +593,7 @@ def setting_channel(item): channel_language = config.get_setting("channel_language", default="auto") if channel_language == 'auto': channel_language = auto_filter() - + list_controls = [] for infile in sorted(glob.glob(channels_path)): From bc5a29d3ed095f3da70bae1a0f700681eb6ded55 Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 15:22:21 +0200 Subject: [PATCH 03/10] fix: specials/news.py per contentLanguage che sono liste --- specials/news.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specials/news.py b/specials/news.py index bf42578d..faf11607 100644 --- a/specials/news.py +++ b/specials/news.py @@ -417,8 +417,13 @@ def get_title(item): title = re.compile("\[/*I\]", re.DOTALL).sub("", title) title = '[B]'+title+'[/B]' - if (type(item.contentLanguage) != list and 'ITA' not in item.contentLanguage) or item.contentLanguage != 'ITA': - title += support.typo(item.contentLanguage, '_ [] color kod') + if type(item.contentLanguage) == list and len(item.contentLanguage) ==1: + if 'ITA' not in item.contentLanguage: + title += support.typo(item.contentLanguage[0], '_ [] color kod') + elif type(item.contentLanguage) != list and item.contentLanguage != 'ITA': + title += support.typo(item.contentLanguage, '_ [] color kod') + else: + title += item.contentLanguage if item.quality: title += support.typo(item.quality, '_ [] color kod') return title From 5c2b8b4da30480e6eb9ebe041dc0afb5f0addace Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Tue, 24 Sep 2019 20:24:54 +0200 Subject: [PATCH 04/10] VVVVID Aggiunti Film e Serie (problemi con la rinumerazione) --- channels/vvvvid.py | 164 +++++++++++++++++++++++++++---------------- servers/directo.json | 7 +- servers/directo.py | 5 +- servers/vvvvid.json | 4 -- servers/vvvvid.py | 48 ++++++------- 5 files changed, 135 insertions(+), 93 deletions(-) diff --git a/channels/vvvvid.py b/channels/vvvvid.py index 3f5584d6..c3374097 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -5,6 +5,7 @@ import requests, re from core import support, tmdb from core.item import Item +from specials import autorenumber __channel__ = "vvvvid" host = support.config.get_channel_url(__channel__) @@ -19,70 +20,79 @@ conn_id = current_session.get(login_page, headers=headers).json()['data']['conn_ payload = {'conn_id': conn_id} main_host = host -host += '/vvvvid/ondemand' +host += '/vvvvid/ondemand/' list_servers = ['vvvvid'] list_quality = ['default'] @support.menu def mainlist(item): - anime = ['/anime/channels/', - ('In Evidenza',['/anime/channel/10005/last/', 'peliculas', 'sort']), - ('Popolari',['/anime/channel/10003/last/', 'peliculas', 'sort']), - ('Nuove Uscite',['/anime/channel/10007/last/', 'peliculas', 'sort']), - ('Generi',['/anime/channels/', 'peliculas', '/anime/channel/10004/last/?category=']), - ('A-Z',['/anime/channels/', 'peliculas', '/anime/channel/10003/last/?filter=']), - ('Extra',['/anime/channels/', 'peliculas', '/anime/channel/10010/last/?extras=']) + anime = ['anime/', + ('In Evidenza',['anime/', 'peliculas', 'channel/10005/last/']), + ('Popolari',['anime/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['anime/', 'peliculas', 'channel/10007/last/']), + ('Generi',['anime/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['anime/', 'peliculas', 'channel/10003/last/?filter=']) + ] + film = ['film/', + ('In Evidenza',['film/', 'peliculas', 'channel/10005/last/']), + ('Popolari',['film/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['film/', 'peliculas', 'channel/10007/last/']), + ('Generi',['film/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['film/', 'peliculas', 'channel/10003/last/?filter=']), + ] + tvshow = ['series/', + ('In Evidenza',['series/', 'peliculas', 'channel/10005/last/']), + ('Popolari',['series/', 'peliculas', 'channel/10002/last/']), + ('Nuove Uscite',['series/', 'peliculas', 'channel/10007/last/']), + ('Generi',['series/', 'peliculas', 'channel/10004/last/?category=']), + ('A-Z',['series/', 'peliculas', 'channel/10003/last/?filter=']) ] return locals() +def search(item, text): + support.log(text) + itemlist = [] + if 'film' in item.url: item.contentType = 'movie' + else: item.contentType = 'tvshow' + item.search = text + itemlist = peliculas(item) + return itemlist + def peliculas(item): itemlist = [] - blacklist = ['Generi','A - Z', 'Extra'] - json_file = current_session.get(item.url, headers=headers, params=payload).json() - support.log(json_file) - if 'data' in json_file: - if not item.args: - names = [i['filter'] for i in json_file['data'] if 'filter' in i][0] - for name in names: - support.log(name) - url = item.url + '10003/last/?filter=' + str(name) + if not item.args: + json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json() + names = [i['filter'] for i in json_file['data'] if 'filter' in i][0] + for name in names: + url = item.url + 'channel/10003/last/?filter=' + str(name) + json_file = current_session.get(url, headers=headers, params=payload).json() + if 'data' in json_file: json_file = current_session.get(url, headers=headers, params=payload).json() - if 'data' in json_file: - json_file = current_session.get(url, headers=headers, params=payload).json() - for key in json_file['data']: - support.log(key['thumbnail']) - itemlist.append( - Item( - channel = item.channel, - title = key['title'], - fulltitle= key['title'], - show= key['title'], - url= host + '/' + str(key['show_id']) + '/seasons/', - action= 'episodios' - )) - elif item.args == 'sort': - for key in json_file['data']: - for key in json_file['data']: - itemlist.append( - Item( - channel = item.channel, - title = key['title'], - fulltitle= key['title'], - show= key['title'], - url= host + '/' + str(key['show_id']) + '/seasons/', - action= 'episodios', - thumbnail= key['thumbnail'] - )) - elif 'last' in item.args: - Filter = support.match(item.args,r'\?([^=]+)=')[0][0] - keys = [i[Filter] for i in json_file['data'] if Filter in i][0] - for key in keys: + make_itemlist(itemlist, item, json_file) + + elif ('=' not in item.args) and ('=' not in item.url): + json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json() + for key in json_file['data']: + make_itemlist(itemlist, item, json_file) + + elif '=' in item.args: + json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json() + Filter = support.match(item.args,r'\?([^=]+)=')[0][0] + keys = [i[Filter] for i in json_file['data'] if Filter in i][0] + for key in keys: + if key not in ['1','2']: itemlist.append( Item(channel = item.channel, - title = key if Filter == 'filter' else key['name'], - url = host + item.args + (key if Filter == 'filter' else str(key['id'])), + title = support.typo(key.upper() if Filter == 'filter' else key['name'], 'bold'), + url = item.url + item.args + (key if Filter == 'filter' else str(key['id'])), action = 'peliculas', - args = 'sort')) + args = 'filters', + contentType = item.contentType)) + + else : + json_file = current_session.get(item.url, headers=headers, params=payload).json() + make_itemlist(itemlist, item, json_file) + if item.contentType != 'movie': autorenumber.renumber(itemlist) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist @@ -90,30 +100,66 @@ def episodios(item): itemlist = [] json_file = current_session.get(item.url, headers=headers, params=payload).json() show_id = str(json_file['data'][0]['show_id']) - for key in json_file['data'][0]['episodes']: - support.log(key) - support.log('KEY= ',key) itemlist.append( Item( channel = item.channel, title = 'Episodio ' + str(key['number']) + ' - ' + key['title'], fulltitle= item.fulltitle, show= item.show, - url= host + '/' + show_id + '/season/' + str(key['season_id']) + '/', + url= host + show_id + '/season/' + str(key['season_id']) + '/', action= 'findvideos', - video_id= key['video_id'] + video_id= key['video_id'], + contentType = item.contentType )) + autorenumber.renumber(itemlist, item, 'bold') + support.videolibrary(itemlist,item) return itemlist def findvideos(item): from lib import vvvvid_decoder itemlist = [] + if item.contentType == 'movie': + json_file = current_session.get(item.url, headers=headers, params=payload).json() + item.url = host + str(json_file['data'][0]['show_id']) + '/season/' + str(json_file['data'][0]['episodes'][0]['season_id']) + '/' + item.video_id = json_file['data'][0]['episodes'][0]['video_id'] + json_file = current_session.get(item.url, headers=headers, params=payload).json() - support.log(json_file['data']) for episode in json_file['data']: if episode['video_id'] == item.video_id: - url = vvvvid_decoder.dec_ei(episode['embed_info']) + url = vvvvid_decoder.dec_ei(episode['embed_info'] or episode['embed_info']) item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/') - if 'https' not in item.url: item.url = url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u' - return support.server(item) + if 'https' not in item.url: + url = support.match(item, url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')[1] + url = url.split()[-1] + itemlist.append( + Item(action= 'play', + title='direct', + url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url, + server= 'directo') + ) + return support.server(item, itemlist=itemlist) + +def make_itemlist(itemlist, item, data): + search = item.search if item.search else '' + infoLabels = {} + for key in data['data']: + if search.lower() in key['title'].lower(): + infoLabels['year'] = key['date_published'] + infoLabels['title'] = infoLabels['tvshowtitle'] = key['title'] + support.log(infoLabels) + itemlist.append( + Item( + channel = item.channel, + title = support.typo(key['title'], 'bold'), + fulltitle= key['title'], + show= key['title'], + url= host + str(key['show_id']) + '/seasons/', + action= 'findvideos' if item.contentType == 'movie' else 'episodios', + contentType = item.contentType, + contentSerieName= key['title'] if item.contentType != 'movie' else '', + contentTitle= key['title'] if item.contentType == 'movie' else '', + thumbnail= key['thumbnail'], + infoLabels=infoLabels + )) + return itemlist \ No newline at end of file diff --git a/servers/directo.json b/servers/directo.json index abe594fd..b3ee714e 100644 --- a/servers/directo.json +++ b/servers/directo.json @@ -3,6 +3,11 @@ "find_videos": { "ignore_urls": [], "patterns": [ + { + "pattern": "((?:http://|https://).*?m3u8)", + "url": "\\1" + + }, { "pattern": "(http://[a-zA-Z0-9]+\\.mysites\\.com\\/get_file\\/.*?\\.mp4)", "url": "\\1" @@ -35,7 +40,7 @@ }, "free": true, "id": "directo", - "name": "directo", + "name": "direct", "settings": [ { "default": false, diff --git a/servers/directo.py b/servers/directo.py index 085092c4..d3db16e9 100644 --- a/servers/directo.py +++ b/servers/directo.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -from platformcode import logger +from platformcode import logger, config # Returns an array of possible video url's from the page_url def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) + logger.info('PAGE URL= ' + page_url) - video_urls = [["%s [directo]" % page_url[-4:], page_url]] + video_urls = [["%s %s" % (page_url[-4:], config.get_localized_string(30137)), page_url]] return video_urls diff --git a/servers/vvvvid.json b/servers/vvvvid.json index e6542e90..d3205cfb 100644 --- a/servers/vvvvid.json +++ b/servers/vvvvid.json @@ -3,10 +3,6 @@ "find_videos": { "ignore_urls": [], "patterns": [ - { - "pattern": "(https://vvvvid-vh.akamaihd.net/i/.*?m3u8)", - "url": "\\1" - }, { "pattern": "https://www.vvvvid.it/.*?show/([a-z0-9/-]+)", "url": "https://www.vvvvid.it/show/\\1" diff --git a/servers/vvvvid.py b/servers/vvvvid.py index d0dacbf4..e66412a3 100644 --- a/servers/vvvvid.py +++ b/servers/vvvvid.py @@ -27,37 +27,31 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): video_urls = [] - # if Direct - if 'm3u8' in page_url: - filename = '[B]' + re.findall('/([a-zA-Z0-9_]+.mp4)', page_url)[0] + '[/B]' - video_urls.append([filename, str(page_url)]) - - # if Page - else: - page_url = page_url.replace("/show/","/#!show/") - # Getting info from given URL - show_id = re.findall("#!show/([0-9]+)/", page_url)[0] - name = re.findall(show_id + "/(.+?)/", page_url)[0] - season_id = re.findall(name + "/(.+?)/", page_url)[0] - video_id = re.findall(season_id + "/(.+?)/", page_url)[0] - - # Getting info from Site - json_url = "https://www.vvvvid.it/vvvvid/ondemand/" + show_id + '/season/' +season_id + '/' - # logger.info('URL= ' + json_url) - json_file = current_session.get(json_url, headers=headers, params=payload).json() - # logger.info(json_file['data']) + page_url = page_url.replace("/show/","/#!show/") - # Search for the correct episode - for episode in json_file['data']: - # import web_pdb; web_pdb.set_trace() - if episode['video_id'] == int(video_id): - ep_title = '[B]' + episode['title'] + '[/B]' - embed_info = vvvvid_decoder.dec_ei(episode['embed_info']) - embed_info = embed_info.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/') + # Getting info from given URL + show_id = re.findall("#!show/([0-9]+)/", page_url)[0] + name = re.findall(show_id + "/(.+?)/", page_url)[0] + season_id = re.findall(name + "/(.+?)/", page_url)[0] + video_id = re.findall(season_id + "/(.+?)/", page_url)[0] + # Getting info from Site + json_url = "https://www.vvvvid.it/vvvvid/ondemand/" + show_id + '/season/' +season_id + '/' + # logger.info('URL= ' + json_url) + json_file = current_session.get(json_url, headers=headers, params=payload).json() + logger.info(json_file['data']) + + # Search for the correct episode + for episode in json_file['data']: # import web_pdb; web_pdb.set_trace() + if episode['video_id'] == int(video_id): + ep_title = '[B]' + episode['title'] + '[/B]' + embed_info = vvvvid_decoder.dec_ei(episode['embed_info']) + embed_info = embed_info.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/') - video_urls.append([ep_title, str(embed_info)]) + # import web_pdb; web_pdb.set_trace() + + video_urls.append([ep_title, str(embed_info)]) return video_urls \ No newline at end of file From b1a83cda4b090abea7d8eb203f29ba065077cbd9 Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 21:24:27 +0200 Subject: [PATCH 05/10] revert: support.py --- core/support.py | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/core/support.py b/core/support.py index 144738d0..7f45d2e8 100644 --- a/core/support.py +++ b/core/support.py @@ -157,33 +157,14 @@ def scrapeLang(scraped, lang, longtitle): # e credo sia utile per filtertools language = '' -## if scraped['lang']: -## if 'ita' in scraped['lang'].lower(): -## language = 'ITA' -## if 'sub' in scraped['lang'].lower(): -## language = 'Sub-' + language -## # se scraped['lang'] è None -## # nei siti dove la lingua è opzionale per il sub-ita e manca l'ita -## else: -## lang = 'ITA' -## if not language: language = lang -## if language: longtitle += typo(language, '_ [] color kod') - - if not scraped['lang'] and lang == '': - language = 'ITA' # setta contentLanguage - elif not scraped['lang'] and lang: - # in caso di deflang attiva - language = lang - if language != 'ITA': - longtitle += typo(language, '_ [] color kod') - else: + if scraped['lang']: if 'ita' in scraped['lang'].lower(): language = 'ITA' if 'sub' in scraped['lang'].lower(): language = 'Sub-' + language - if language != '': - longtitle += typo(language, '_ [] color kod') + if not language: language = lang + if language: longtitle += typo(language, '_ [] color kod') return language, longtitle @@ -203,6 +184,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] stagione = '' # per quei siti che hanno la stagione nel blocco ma non nelle puntate for i, match in enumerate(matches): + lang = '' if pagination and (pag - 1) * pagination > i: continue # pagination if pagination and i >= pag * pagination: break # pagination listGroups = match.keys() @@ -242,7 +224,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t lang, longtitle = scrapeLang(scraped, lang, longtitle) - if lang == '': lang = 'ITA' + # if title is set, probably this is a list of episodes or video sources # necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie if item.infoLabels["title"] == scraped["title"]: From e1730fdb79646d6ec760acfc22de8d6c38994cbe Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 21:24:55 +0200 Subject: [PATCH 06/10] fix: news --- specials/news.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/specials/news.py b/specials/news.py index faf11607..ed85e96b 100644 --- a/specials/news.py +++ b/specials/news.py @@ -417,13 +417,16 @@ def get_title(item): title = re.compile("\[/*I\]", re.DOTALL).sub("", title) title = '[B]'+title+'[/B]' - if type(item.contentLanguage) == list and len(item.contentLanguage) ==1: - if 'ITA' not in item.contentLanguage: - title += support.typo(item.contentLanguage[0], '_ [] color kod') - elif type(item.contentLanguage) != list and item.contentLanguage != 'ITA': + + if item.contentLanguage == '': + pass + elif type(item.contentLanguage) == list and len(item.contentLanguage) ==1: + title += support.typo(item.contentLanguage[0], '_ [] color kod') + elif type(item.contentLanguage) != '': title += support.typo(item.contentLanguage, '_ [] color kod') - else: + elif type(item.contentLanguage) == list: title += item.contentLanguage + if item.quality: title += support.typo(item.quality, '_ [] color kod') return title @@ -432,7 +435,6 @@ def get_title(item): def no_group(list_result_canal): itemlist = [] global channels_id_name - support.log("NO GROUP -> ", list_result_canal) for i in list_result_canal: support.log("NO GROUP i -> ", i) From 80422ba7307ecb5dacd4194a2277b959fbd390c0 Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 22:52:19 +0200 Subject: [PATCH 07/10] fix: lang in support.py cambiato nome a una variabile --- core/support.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/support.py b/core/support.py index 7f45d2e8..d0e8a16d 100644 --- a/core/support.py +++ b/core/support.py @@ -184,7 +184,6 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] stagione = '' # per quei siti che hanno la stagione nel blocco ma non nelle puntate for i, match in enumerate(matches): - lang = '' if pagination and (pag - 1) * pagination > i: continue # pagination if pagination and i >= pag * pagination: break # pagination listGroups = match.keys() @@ -202,9 +201,9 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t scraped[kk] = val if scraped['season'] != None: - stagione = scraped['season'] + season = scraped['season'] if stagione: - episode = stagione +'x'+ scraped['episode'] + episode = season +'x'+ scraped['episode'] else: episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else '' @@ -217,13 +216,13 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t # make formatted Title [longtitle] s = ' - ' - title = episode + (s if episode and title else '') + title + title = episode + (s if episode and title else '') + title longtitle = title + (s if title and title2 else '') + title2 longtitle = typo(longtitle, 'bold') - longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '') + longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '') - lang, longtitle = scrapeLang(scraped, lang, longtitle) + lang1, longtitle = scrapeLang(scraped, lang, longtitle) # if title is set, probably this is a list of episodes or video sources # necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie @@ -278,8 +277,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t args=item.args, contentSerieName= title if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '', contentTitle= title if item.contentType or CT == 'movie' else '', - contentLanguage = lang, - ep=episode if episode else '' + contentLanguage = lang1, + contentEpisodeNumber=episode if episode else '' ) for lg in list(set(listGroups).difference(known_keys)): @@ -366,8 +365,10 @@ def scrape(func): blockItemlist, blockMatches = scrapeBlock(item, args, bl['block'], patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function, lang) for it in blockItemlist: + log('IT LANG ----> ', it) if 'lang' in bl: it.contentLanguage, it.title = scrapeLang(bl, it.contentLanguage, it.title) + log('IT LANG ----> ', it.contentLanguage) if 'quality' in bl and bl['quality']: it.quality = bl['quality'].strip() it.title = it.title + typo(bl['quality'].strip(), '_ [] color kod') From 80328cc998c3bda1af684207cff5d8263fb7c78c Mon Sep 17 00:00:00 2001 From: greko17 Date: Tue, 24 Sep 2019 23:30:47 +0200 Subject: [PATCH 08/10] fix: aggiunta eccezione --- specials/checkhost.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specials/checkhost.py b/specials/checkhost.py index 633173b1..a70b0f02 100644 --- a/specials/checkhost.py +++ b/specials/checkhost.py @@ -172,6 +172,8 @@ class Kdicc(): # per siti irraggiungibili senza DNS corretti #[Errno 111] Connection refused rslt['code'] = 111 + except: + rslt['code'] = 'Connection error' return rslt def view_Advise(self, txt = '' ): From 2f2f14523f4ca6d959a9b9cc57803f33312be673 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Wed, 25 Sep 2019 20:38:38 +0200 Subject: [PATCH 09/10] Fix animeworld e VVVVID(beta) --- channels/animeworld.py | 4 +++- channels/vvvvid.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/channels/animeworld.py b/channels/animeworld.py index 59c36771..2350436e 100644 --- a/channels/animeworld.py +++ b/channels/animeworld.py @@ -124,7 +124,9 @@ def peliculas(item): @support.scrape def episodios(item): anime=True - patronBlock= r'
.*?)' + data = support.match(item, headers=headers)[1] + if 'VVVVID' in data: patronBlock= r'
.*?)' + else: patronblock= 'server active(?P.*?)server hidden' patron = r'
  • ]+>(?P[^<]+)<' def itemHook(item): item.title += support.typo(item.fulltitle,'-- bold') diff --git a/channels/vvvvid.py b/channels/vvvvid.py index c3374097..d8ebe932 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -72,8 +72,7 @@ def peliculas(item): elif ('=' not in item.args) and ('=' not in item.url): json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json() - for key in json_file['data']: - make_itemlist(itemlist, item, json_file) + make_itemlist(itemlist, item, json_file) elif '=' in item.args: json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json() From d367e0a603c68f61cd25ffb06dee65877034e224 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Wed, 25 Sep 2019 20:54:42 +0200 Subject: [PATCH 10/10] VVVVID Nuove Sezioni --- channels/vvvvid.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/channels/vvvvid.py b/channels/vvvvid.py index d8ebe932..cf8e05d3 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -47,6 +47,22 @@ def mainlist(item): ('Generi',['series/', 'peliculas', 'channel/10004/last/?category=']), ('A-Z',['series/', 'peliculas', 'channel/10003/last/?filter=']) ] + show = [('Show bold',['show/', 'peliculas', 'channel/10005/last/', 'tvshow']), + ('In Evidenza submenu',['show/', 'peliculas', 'channel/10005/last/', 'tvshow']), + ('Popolari submenu',['show/', 'peliculas', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite submenu',['show/', 'peliculas', 'channel/10007/last/', 'tvshow']), + ('Generi submenu',['show/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z submenu',['show/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + ('Cerca Show... bold submenu', ['show/', 'search', '', 'tvshow']) + ] + kids = [('Kids bold',['kids/', 'peliculas', 'channel/10005/last/', 'tvshow']), + ('In Evidenza submenu',['kids/', 'peliculas', 'channel/10005/last/', 'tvshow']), + ('Popolari submenu',['kids/', 'peliculas', 'channel/10002/last/', 'tvshow']), + ('Nuove Uscite submenu',['kids/', 'peliculas', 'channel/10007/last/', 'tvshow']), + ('Generi submenu',['kids/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']), + ('A-Z submenu',['kids/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']), + ('Cerca Show... bold submenu', ['kids/', 'search', '', 'tvshow']) + ] return locals() def search(item, text): @@ -127,6 +143,7 @@ def findvideos(item): for episode in json_file['data']: if episode['video_id'] == item.video_id: url = vvvvid_decoder.dec_ei(episode['embed_info'] or episode['embed_info']) + if 'youtube' in url: item.url = url item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/') if 'https' not in item.url: url = support.match(item, url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')[1]