From 8fee70efc64e380728776294aec9075a20e62c2c Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Fri, 27 Sep 2019 12:21:50 +0200 Subject: [PATCH 1/2] VVVVID Supporto Videoteca MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit non è ancora possibile avere più di 15 risultati :.( --- channels/vvvvid.py | 7 ++++--- core/support.py | 4 ++-- specials/autorenumber.py | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/channels/vvvvid.py b/channels/vvvvid.py index cf8e05d3..af5c7ec6 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -119,7 +119,7 @@ def episodios(item): itemlist.append( Item( channel = item.channel, - title = 'Episodio ' + str(key['number']) + ' - ' + key['title'], + title = 'Episodio ' + key['number'].encode('ascii', 'replace') + ' - ' + key['title'], fulltitle= item.fulltitle, show= item.show, url= host + show_id + '/season/' + str(key['season_id']) + '/', @@ -128,7 +128,8 @@ def episodios(item): contentType = item.contentType )) autorenumber.renumber(itemlist, item, 'bold') - support.videolibrary(itemlist,item) + if autorenumber.check(item) == True: + support.videolibrary(itemlist,item) return itemlist def findvideos(item): @@ -154,7 +155,7 @@ def findvideos(item): url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url, server= 'directo') ) - return support.server(item, itemlist=itemlist) + return support.server(item, itemlist=itemlist, download=False) def make_itemlist(itemlist, item, data): search = item.search if item.search else '' diff --git a/core/support.py b/core/support.py index d0e8a16d..e77e0d95 100644 --- a/core/support.py +++ b/core/support.py @@ -878,7 +878,7 @@ def pagination(itemlist, item, page, perpage, function_level=1): thumbnail=thumb())) return itemlist -def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True): +def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True, download=True): if not data: data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data @@ -929,7 +929,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True): autoplay.start(itemlist, item) if item.contentChannel != 'videolibrary': videolibrary(itemlist, item, function_level=3) - if get_setting('downloadenabled'): download(itemlist, item, function_level=3) + if get_setting('downloadenabled') and download == True: download(itemlist, item, function_level=3) return itemlist def filterLang(item, itemlist): diff --git a/specials/autorenumber.py b/specials/autorenumber.py index e04a69b9..62482c12 100644 --- a/specials/autorenumber.py +++ b/specials/autorenumber.py @@ -262,7 +262,8 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, if len(EpisodeDict) >= len(itemlist): for item in itemlist: number = scrapertoolsV2.find_single_match(item.title, r'\d+') - if number != '0': number.lstrip("0") + log('TIPO NUMBER= ', type(number)) + number = int(number) item.title = typo(EpisodeDict[str(number)] + ' - ', typography) + item.title else: make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE) From 08a930567af077b32633cdcf6f5569c66a533bb8 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Fri, 27 Sep 2019 17:10:16 +0200 Subject: [PATCH 2/2] VVVVID Fix Stagioni Multiple --- channels/vvvvid.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/channels/vvvvid.py b/channels/vvvvid.py index af5c7ec6..d4ef68ec 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -115,18 +115,27 @@ 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']: - itemlist.append( - Item( - channel = item.channel, + episodes = [] + for episode in json_file['data']: + episodes.append(episode['episodes']) + for episode in episodes: + for key in episode: + if 'stagione' in key['title'].lower(): + match = support.match(key['title'].encode('ascii', 'replace'), r'[Ss]tagione\s*(\d+) - [Ee]pisodio\s*(\d+)')[0][0] + title = match[0]+'x'+match[1] + ' - ' + item.fulltitle + else: title = 'Episodio ' + key['number'].encode('ascii', 'replace') + ' - ' + key['title'], - fulltitle= item.fulltitle, - show= item.show, - url= host + show_id + '/season/' + str(key['season_id']) + '/', - action= 'findvideos', - video_id= key['video_id'], - contentType = item.contentType - )) + itemlist.append( + Item( + channel = item.channel, + title = title, + fulltitle= item.fulltitle, + show= item.show, + url= host + show_id + '/season/' + str(key['season_id']) + '/', + action= 'findvideos', + video_id= key['video_id'], + contentType = item.contentType + )) autorenumber.renumber(itemlist, item, 'bold') if autorenumber.check(item) == True: support.videolibrary(itemlist,item)