From 4d517912868e23d1d3fb39b89609064fa6f35452 Mon Sep 17 00:00:00 2001 From: danielr460 Date: Thu, 17 Jan 2019 10:44:44 -0500 Subject: [PATCH] Seodiv: Reestructurado --- plugin.video.alfa/channels/seodiv.json | 2 +- plugin.video.alfa/channels/seodiv.py | 209 ++++++++----------------- 2 files changed, 63 insertions(+), 148 deletions(-) diff --git a/plugin.video.alfa/channels/seodiv.json b/plugin.video.alfa/channels/seodiv.json index cb4a6bde..79241049 100755 --- a/plugin.video.alfa/channels/seodiv.json +++ b/plugin.video.alfa/channels/seodiv.json @@ -1,7 +1,7 @@ { "id": "seodiv", "name": "Seodiv", - "active": false, + "active": true, "adult": false, "language": ["lat"], "thumbnail": "https://s32.postimg.cc/gh8lhbkb9/seodiv.png", diff --git a/plugin.video.alfa/channels/seodiv.py b/plugin.video.alfa/channels/seodiv.py index 1fca076f..83cf2aaa 100755 --- a/plugin.video.alfa/channels/seodiv.py +++ b/plugin.video.alfa/channels/seodiv.py @@ -47,8 +47,7 @@ def todas(item): itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) - patron = '
.*?quality(.*?)<.*?Ver ' \ - 'Serie>(.*?)<\/span>' + patron = '
<\/a><\/div>' matches = re.compile(patron, re.DOTALL).findall(data) # Paginacion @@ -57,16 +56,15 @@ def todas(item): min=int(min)-int(item.page) max = min + num_items_x_pagina - 1 - for scrapedurl, scrapedthumbnail, scrapedcalidad, scrapedtitle in matches[min:max]: + for scrapedurl, scrapedtitle, scrapedthumbnail, in matches[min:max]: url = host + scrapedurl - calidad = scrapedcalidad title = scrapedtitle.decode('utf-8') thumbnail = scrapedthumbnail fanart = 'https://s32.postimg.cc/gh8lhbkb9/seodiv.png' - if not 'xxxxxx' in scrapedtitle: + if 'TITULO' != title: itemlist.append( Item(channel=item.channel, - action="temporadas", + action="episodios", title=title, url=url, thumbnail=thumbnail, fanart=fanart, @@ -85,153 +83,70 @@ def todas(item): return itemlist -def temporadas(item): - logger.info() - itemlist = [] - data = get_source(item.url) - url_base = item.url - patron = '
  • (.*?) <\/a>' - matches = re.compile(patron, re.DOTALL).findall(data) - temp = 1 - if matches: - for scrapedtitle in matches: - url = url_base - tempo = re.findall(r'\d+', scrapedtitle) - # if tempo: - # title = 'Temporada' + ' ' + tempo[0] - # else: - title = scrapedtitle - thumbnail = item.thumbnail - plot = item.plot - fanart = scrapertools.find_single_match(data, '.*?') - itemlist.append( - Item(channel=item.channel, - action="episodiosxtemp", - title=title, - fulltitle=item.title, - url=url, - thumbnail=thumbnail, - plot=plot, fanart=fanart, - temp=str(temp), - contentSerieName=item.contentSerieName, - context=item.context - )) - temp = temp + 1 - - if config.get_videolibrary_support() and len(itemlist) > 0: - itemlist.append( - Item(channel=item.channel, - title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', - url=item.url, - action="add_serie_to_library", - extra="episodios", - contentSerieName=item.contentSerieName, - extra1=item.extra1, - temp=str(temp) - )) - return itemlist - else: - itemlist = episodiosxtemp(item) - if config.get_videolibrary_support() and len(itemlist) > 0: - itemlist.append( - Item(channel=item.channel, - title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', - url=item.url, - action="add_serie_to_library", - extra="episodios", - contentSerieName=item.contentSerieName, - extra1=item.extra1, - temp=str(temp) - )) - return itemlist - - def episodios(item): logger.info() itemlist = [] - templist = temporadas(item) - for tempitem in templist: - itemlist += episodiosxtemp(tempitem) - - return itemlist - - -def get_source(url): - logger.info() - data = httptools.downloadpage(url, add_referer=True).data + data = httptools.downloadpage(item.url).data data = re.sub(r'"|\n|\r|\t| |
    |\s{2,}', "", data) - return data - - -def episodiosxtemp(item): - logger.info() - - logger.info() - itemlist = [] - item.title = 'Temporada %s' % item.temp.zfill(2) - patron_temp = '
  • %s <\/a>