From ab63a093cce90307850fd34fcddbc448b47cac4a Mon Sep 17 00:00:00 2001 From: mac12m99 Date: Sun, 26 May 2019 17:51:18 +0200 Subject: [PATCH] fix autoplay in cb01 and a little change on support and autoplay --- channels/cineblog01.py | 42 ++++++++++-------------------------------- core/support.py | 9 +++++---- specials/autoplay.py | 2 +- 3 files changed, 16 insertions(+), 37 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index a2cb2401..f2c803cc 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -25,7 +25,7 @@ def findhost(): IDIOMAS = {'Italiano': 'IT'} list_language = IDIOMAS.values() list_servers = ['verystream', 'openload', 'streamango', 'wstream'] -list_quality = ['HD', 'default'] +list_quality = ['HD', 'SD', 'default'] checklinks = config.get_setting('checklinks', 'cineblog01') checklinks_number = config.get_setting('checklinks_number', 'cineblog01') @@ -33,7 +33,7 @@ checklinks_number = config.get_setting('checklinks_number', 'cineblog01') # esclusione degli articoli 'di servizio' blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', 'Aggiornamento Quotidiano Serie TV', 'OSCAR 2019 ▶ CB01.UNO: Vota il tuo film preferito! 🎬', - 'Openload: la situazione. Benvenuto Verystream'] + 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?'] def mainlist(item): @@ -230,11 +230,10 @@ def findvideos(item): matches = re.compile(patron, re.DOTALL).findall(streaming) for scrapedurl, scrapedtitle in matches: logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle)) - title = "[COLOR " + color + "]" + desc_txt + ":[/COLOR] " + item.fulltitle + " [COLOR grey]" + QualityStr + "[/COLOR] [COLOR blue][" + scrapedtitle + "][/COLOR]" itemlist.append( Item(channel=item.channel, action="play", - title=title, + title=scrapedtitle, url=scrapedurl, server=scrapedtitle, fulltitle=item.fulltitle, @@ -265,37 +264,18 @@ def findvideos(item): # Estrae i contenuti - Streaming HD load_links(itemlist, 'Streaming HD[^<]+(.*?)', "yellow", "Streaming HD", "HD") - autoplay.start(itemlist, item) - # Estrae i contenuti - Streaming 3D load_links(itemlist, 'Streaming 3D[^<]+(.*?)', "pink", "Streaming 3D") + support.videolibrary(itemlist, item) + return support.server(item, itemlist=itemlist) + # Estrae i contenuti - Download # load_links(itemlist, 'Download:(.*?)', "aqua", "Download") # Estrae i contenuti - Download HD # load_links(itemlist, 'Download HD[^<]+(.*?)', "azure", "Download HD") - if len(itemlist) == 0: - itemlist = servertools.find_video_items(item=item) - - # Requerido para Filtrar enlaces - - if checklinks: - itemlist = servertools.check_list_links(itemlist, checklinks_number) - - # Requerido para FilterTools - - # itemlist = filtertools.get_links(itemlist, item, list_language) - - # Requerido para AutoPlay - - autoplay.start(itemlist, item) - - support.videolibrary(itemlist, item) - - return itemlist - def findvid_serie(item): def load_vid_series(html, item, itemlist, blktxt): @@ -306,11 +286,11 @@ def findvid_serie(item): for match in matches: scrapedurl = match.group(1) scrapedtitle = match.group(2) - title = item.title + " [COLOR blue][" + scrapedtitle + "][/COLOR]" + # title = item.title + " [COLOR blue][" + scrapedtitle + "][/COLOR]" itemlist.append( Item(channel=item.channel, action="play", - title=title, + title=scrapedtitle, url=scrapedurl, server=scrapedtitle, fulltitle=item.fulltitle, @@ -354,9 +334,7 @@ def findvid_serie(item): else: load_vid_series(data[lnkblkp[i]:lnkblkp[i + 1]], item, itemlist, lnkblk[i]) - autoplay.start(itemlist, item) - - return itemlist + return support.server(item, itemlist=itemlist) def play(item): @@ -390,4 +368,4 @@ def play(item): else: data = support.swzz_get_url(item) - return support.server(item, data, headers) + return servertools.find_video_items(data=data) diff --git a/core/support.py b/core/support.py index 800a880a..74a5a9e4 100644 --- a/core/support.py +++ b/core/support.py @@ -492,15 +492,16 @@ def nextPage(itemlist, item, data, patron, function_level=1): return itemlist -def server(item, data='', headers='', AutoPlay=True, CheckLinks=True): +def server(item, data='', itemlist='', headers='', AutoPlay=True, CheckLinks=True): if not data: data = httptools.downloadpage(item.url, headers=headers).data - - itemlist = servertools.find_video_items(data=str(data)) + + if not itemlist: + itemlist = servertools.find_video_items(data=str(data)) for videoitem in itemlist: - videoitem.title = "".join([item.title, ' ', typo(videoitem.title, 'color kod []')]) + videoitem.title = "".join([item.title, ' ', typo(videoitem.title, 'color kod []'), typo(videoitem.quality, 'color kod []') if videoitem.quality else ""]) videoitem.fulltitle = item.fulltitle videoitem.show = item.show videoitem.thumbnail = item.thumbnail diff --git a/specials/autoplay.py b/specials/autoplay.py index e7d11048..b6c851ce 100644 --- a/specials/autoplay.py +++ b/specials/autoplay.py @@ -143,7 +143,7 @@ def start(itemlist, item): # 2: Solo servidores # 3: Solo calidades # 4: No ordenar - if (settings_node['custom_servers'] and settings_node['custom_quality']): + if (settings_node['custom_servers'] and settings_node['custom_quality']) or get_setting('autoplay'): priority = settings_node['priority'] # 0: Servidores y calidades o 1: Calidades y servidores elif settings_node['custom_servers']: priority = 2 # Solo servidores