From c5dffe09dab96304e024ef782c904a64ae74439b Mon Sep 17 00:00:00 2001 From: Intel1 Date: Sat, 1 Sep 2018 10:15:42 -0500 Subject: [PATCH 01/18] Eliminados y actualizados servers cloudsany, nowvideo, oboom, playwatch, playwire, rutube, streame, veoh, vidabc, videowood, vidgg, vidgot, vidzella, watchers, wholecloud: eliminados gounlimited, thevideome, watchvideo fix --- plugin.video.alfa/servers/cloudsany.json | 42 ------------ plugin.video.alfa/servers/cloudsany.py | 33 --------- plugin.video.alfa/servers/gounlimited.py | 8 +-- plugin.video.alfa/servers/nowvideo.json | 71 ------------------- plugin.video.alfa/servers/nowvideo.py | 59 ---------------- plugin.video.alfa/servers/oboom.json | 44 ------------ plugin.video.alfa/servers/oboom.py | 9 --- plugin.video.alfa/servers/playwatch.json | 42 ------------ plugin.video.alfa/servers/playwatch.py | 34 --------- plugin.video.alfa/servers/playwire.json | 41 ----------- plugin.video.alfa/servers/playwire.py | 45 ------------ plugin.video.alfa/servers/rutube.json | 45 ------------ plugin.video.alfa/servers/rutube.py | 37 ---------- plugin.video.alfa/servers/streame.json | 41 ----------- plugin.video.alfa/servers/streame.py | 29 -------- plugin.video.alfa/servers/thevideome.py | 4 +- plugin.video.alfa/servers/veoh.json | 45 ------------ plugin.video.alfa/servers/veoh.py | 32 --------- plugin.video.alfa/servers/vidabc.json | 41 ----------- plugin.video.alfa/servers/vidabc.py | 54 --------------- plugin.video.alfa/servers/videowood.json | 41 ----------- plugin.video.alfa/servers/videowood.py | 26 ------- plugin.video.alfa/servers/vidgg.json | 41 ----------- plugin.video.alfa/servers/vidgg.py | 53 -------------- plugin.video.alfa/servers/vidgot.py | 36 ---------- plugin.video.alfa/servers/vidlox.json | 84 +++++++++++------------ plugin.video.alfa/servers/vidzella.json | 42 ------------ plugin.video.alfa/servers/vidzella.py | 33 --------- plugin.video.alfa/servers/watchers.json | 42 ------------ plugin.video.alfa/servers/watchers.py | 36 ---------- plugin.video.alfa/servers/watchvideo.py | 7 +- plugin.video.alfa/servers/wholecloud.json | 42 ------------ plugin.video.alfa/servers/wholecloud.py | 38 ---------- 33 files changed, 54 insertions(+), 1223 deletions(-) delete mode 100644 plugin.video.alfa/servers/cloudsany.json delete mode 100644 plugin.video.alfa/servers/cloudsany.py delete mode 100755 plugin.video.alfa/servers/nowvideo.json delete mode 100755 plugin.video.alfa/servers/nowvideo.py delete mode 100755 plugin.video.alfa/servers/oboom.json delete mode 100755 plugin.video.alfa/servers/oboom.py delete mode 100755 plugin.video.alfa/servers/playwatch.json delete mode 100755 plugin.video.alfa/servers/playwatch.py delete mode 100755 plugin.video.alfa/servers/playwire.json delete mode 100755 plugin.video.alfa/servers/playwire.py delete mode 100755 plugin.video.alfa/servers/rutube.json delete mode 100755 plugin.video.alfa/servers/rutube.py delete mode 100755 plugin.video.alfa/servers/streame.json delete mode 100755 plugin.video.alfa/servers/streame.py delete mode 100755 plugin.video.alfa/servers/veoh.json delete mode 100755 plugin.video.alfa/servers/veoh.py delete mode 100755 plugin.video.alfa/servers/vidabc.json delete mode 100755 plugin.video.alfa/servers/vidabc.py delete mode 100755 plugin.video.alfa/servers/videowood.json delete mode 100755 plugin.video.alfa/servers/videowood.py delete mode 100755 plugin.video.alfa/servers/vidgg.json delete mode 100755 plugin.video.alfa/servers/vidgg.py delete mode 100755 plugin.video.alfa/servers/vidgot.py delete mode 100644 plugin.video.alfa/servers/vidzella.json delete mode 100644 plugin.video.alfa/servers/vidzella.py delete mode 100755 plugin.video.alfa/servers/watchers.json delete mode 100755 plugin.video.alfa/servers/watchers.py delete mode 100755 plugin.video.alfa/servers/wholecloud.json delete mode 100755 plugin.video.alfa/servers/wholecloud.py diff --git a/plugin.video.alfa/servers/cloudsany.json b/plugin.video.alfa/servers/cloudsany.json deleted file mode 100644 index 75c373ca..00000000 --- a/plugin.video.alfa/servers/cloudsany.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "cloudsany.com/i/([A-z0-9]+)", - "url": "https://cloudsany.com/i/\\1" - } - ] - }, - "free": true, - "id": "cloudsany", - "name": "cloudsany", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "https://s1.postimg.cc/6wixo35myn/cloudsany1.png" -} diff --git a/plugin.video.alfa/servers/cloudsany.py b/plugin.video.alfa/servers/cloudsany.py deleted file mode 100644 index 67112c5f..00000000 --- a/plugin.video.alfa/servers/cloudsany.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------ -# Alfa addon - KODI Plugin -# Conector para cloudsany -# https://github.com/alfa-addon -# ------------------------------------------------------------ - -from core import httptools -from core import scrapertools -from lib import jsunpack -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - if "no longer exists" in data: - return False, "[Cloudsany] El fichero ha sido borrado" - - return True, "" - - -def get_video_url(page_url, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - data = scrapertools.find_single_match(data, 'p,a,c,k,e.*?') - unpack = jsunpack.unpack(data) - logger.info("Intel11 %s" %unpack) - video_urls = [] - videourl = scrapertools.find_single_match(unpack, 'config={file:"([^"]+)') - video_urls.append([".MP4 [Cloudsany]", videourl]) - - return video_urls diff --git a/plugin.video.alfa/servers/gounlimited.py b/plugin.video.alfa/servers/gounlimited.py index dcf835af..ed02a6f5 100644 --- a/plugin.video.alfa/servers/gounlimited.py +++ b/plugin.video.alfa/servers/gounlimited.py @@ -24,9 +24,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) packed_data = scrapertools.find_single_match(data, "javascript'>(eval.*?)") unpacked = jsunpack.unpack(packed_data) - patron = "file:(.*?),label:(.*?)}" + patron = "sources..([^\]]+)" matches = re.compile(patron, re.DOTALL).findall(unpacked) - for url, quality in matches: - video_urls.append(['%s' % quality, url]) - video_urls.sort(key=lambda x: int(x[0])) + for url in matches: + url += "|Referer=%s" %page_url + video_urls.append(['mp4', url]) return video_urls diff --git a/plugin.video.alfa/servers/nowvideo.json b/plugin.video.alfa/servers/nowvideo.json deleted file mode 100755 index c7298a48..00000000 --- a/plugin.video.alfa/servers/nowvideo.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "nowvideo.../(?:video/|embed.php\\?.*v=)([A-z0-9]+)", - "url": "http://www.nowvideo.sx/video/\\1" - } - ] - }, - "free": true, - "id": "nowvideo", - "name": "nowvideo", - "premium": [ - "nowvideo", - "realdebrid" - ], - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - }, - { - "default": false, - "enabled": true, - "id": "premium", - "label": "Activar cuenta premium", - "type": "bool", - "visible": true - }, - { - "default": "", - "enabled": "eq(-1,true)", - "id": "user", - "label": "@30014", - "type": "text", - "visible": true - }, - { - "default": "", - "enabled": "eq(-2,true)+!eq(-1,'')", - "hidden": true, - "id": "password", - "label": "@30015", - "type": "text", - "visible": true - } - ], - "thumbnail": "server_nowvideo.png" -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/nowvideo.py b/plugin.video.alfa/servers/nowvideo.py deleted file mode 100755 index 5fad7efb..00000000 --- a/plugin.video.alfa/servers/nowvideo.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import httptools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - url = page_url.replace("http://www.nowvideo.sx/video/", "http://embed.nowvideo.sx/embed/?v=") - data = httptools.downloadpage(url).data - if "The file is being converted" in data or "Please try again later" in data: - return False, "El fichero está en proceso" - elif "no longer exists" in data: - return False, "El fichero ha sido borrado" - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - video_urls = [] - if premium: - login_url = "http://www.nowvideo.eu/login.php" - data = httptools.downloadpage(login_url).data - login_url = "http://www.nowvideo.eu/login.php?return=" - post = "user=" + user + "&pass=" + password + "®ister=Login" - headers = {"Referer": "http://www.nowvideo.eu/login.php"} - data = httptools.downloadpage(login_url, post, headers=headers).data - data = httptools.downloadpage(page_url).data - flashvar_file = scrapertools.get_match(data, 'flashvars.file="([^"]+)"') - flashvar_filekey = scrapertools.get_match(data, 'flashvars.filekey=([^;]+);') - flashvar_filekey = scrapertools.get_match(data, 'var ' + flashvar_filekey + '="([^"]+)"') - flashvar_user = scrapertools.get_match(data, 'flashvars.user="([^"]+)"') - flashvar_key = scrapertools.get_match(data, 'flashvars.key="([^"]+)"') - flashvar_type = scrapertools.get_match(data, 'flashvars.type="([^"]+)"') - url = "http://www.nowvideo.eu/api/player.api.php?user=" + flashvar_user + "&file=" + flashvar_file + "&pass=" + flashvar_key + "&cid=1&cid2=undefined&key=" + flashvar_filekey.replace( - ".", "%2E").replace("-", "%2D") + "&cid3=undefined" - data = httptools.downloadpage(url).data - location = scrapertools.get_match(data, 'url=([^\&]+)&') - location = location + "?client=FLASH" - video_urls.append([scrapertools.get_filename_from_url(location)[-4:] + " [premium][nowvideo]", location]) - else: - url = page_url.replace("http://www.nowvideo.sx/video/", "http://embed.nowvideo.sx/embed/?v=") - data = httptools.downloadpage(url).data - videourls = scrapertools.find_multiple_matches(data, 'src\s*:\s*[\'"]([^\'"]+)[\'"]') - if not videourls: - videourls = scrapertools.find_multiple_matches(data, 'Video not found" in data: return False, "[thevideo.me] El archivo ha sido eliminado o no existe" return True, "" diff --git a/plugin.video.alfa/servers/veoh.json b/plugin.video.alfa/servers/veoh.json deleted file mode 100755 index 4ee14cb7..00000000 --- a/plugin.video.alfa/servers/veoh.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "href=\"http://www.veoh.com/.*?permalinkId=([^&\"]+)\"", - "url": "\\1" - }, - { - "pattern": "pattern=\"http://www.veoh.com/static/swf/webplayer/WebPlayer.swf.*?permalinkId=([^&]+)=videodetailsembedded=0=anonymous\"", - "url": "\\1" - } - ] - }, - "free": true, - "id": "veoh", - "name": "veoh", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/veoh.py b/plugin.video.alfa/servers/veoh.py deleted file mode 100755 index 52dd43be..00000000 --- a/plugin.video.alfa/servers/veoh.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import scrapertools -from platformcode import logger - - -# 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) - - video_urls = [] - - # Lo extrae a partir de flashvideodownloader.org - if page_url.startswith("http://"): - url = 'http://www.flashvideodownloader.org/download.php?u=' + page_url - else: - url = 'http://www.flashvideodownloader.org/download.php?u=http://www.veoh.com/watch/' + page_url - logger.info("url=" + url) - data = scrapertools.cachePage(url) - - # Extrae el vídeo - patronvideos = ' 0: - video_urls.append(["[veoh]", matches[0]]) - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls diff --git a/plugin.video.alfa/servers/vidabc.json b/plugin.video.alfa/servers/vidabc.json deleted file mode 100755 index 58201916..00000000 --- a/plugin.video.alfa/servers/vidabc.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "vidabc.com/(?:embed-|)([a-z0-9]+)", - "url": "http://vidabc.com/embed-\\1.html" - } - ] - }, - "free": true, - "id": "vidabc", - "name": "vidabc", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/vidabc.py b/plugin.video.alfa/servers/vidabc.py deleted file mode 100755 index 5b4b4550..00000000 --- a/plugin.video.alfa/servers/vidabc.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -from core.httptools import downloadpage -from core.scrapertools import get_match, find_multiple_matches -from platformcode import logger - -host = "http://vidabc.com" -id_server = "vidabc" - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = downloadpage(page_url).data - if "Video is processing now" in data: - return False, "[vidabc] El archivo se está procesando" - if "File was deleted" in data: - return False, "[vidabc] El archivo ha sido borrado" - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - - data = downloadpage(page_url).data - - try: - sources = get_match(data, 'sources\s*:\s* \[([^\]]+)\]') - except: - from lib import jsunpack - sources = jsunpack.unpack(get_match(data, ']*>(eval.function.p,a,c,k,e,.*?)')) - sources = get_match(sources, 'sources\s*:\s*\[([^\]]+)\]') - - video_urls = [] - for media_url in find_multiple_matches(sources, '"([^"]+)"'): - if media_url.endswith(".mp4"): - video_urls.append([".mp4 [%s]" % id_server, media_url]) - - if media_url.endswith(".m3u8"): - video_urls.append(["M3U8 [%s]" % id_server, media_url]) - - if media_url.endswith(".smil"): - smil_data = downloadpage(media_url).data - - rtmp = get_match(smil_data, 'base="([^"]+)"') - playpaths = find_multiple_matches(smil_data, 'src="([^"]+)" height="(\d+)"') - - for playpath, inf in playpaths: - h = get_match(playpath, 'h=([a-z0-9]+)') - video_urls.append(["RTMP [%s] %s" % (id_server, inf), "%s playpath=%s" % (rtmp, playpath)]) - - for video_url in video_urls: - logger.info("video_url: %s - %s" % (video_url[0], video_url[1])) - - return video_urls diff --git a/plugin.video.alfa/servers/videowood.json b/plugin.video.alfa/servers/videowood.json deleted file mode 100755 index 80c1d189..00000000 --- a/plugin.video.alfa/servers/videowood.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(https?://(?:www.)?videowood.tv/)(?:embed|video)(/[0-9a-z]+)", - "url": "\\1embed\\2" - } - ] - }, - "free": true, - "id": "videowood", - "name": "videowood", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/videowood.py b/plugin.video.alfa/servers/videowood.py deleted file mode 100755 index e9d86825..00000000 --- a/plugin.video.alfa/servers/videowood.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -from aadecode import decode as aadecode -from core import scrapertools -from core import httptools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - if "This video doesn't exist." in data: - return False, '[videowood] El video no puede ser encontrado o ha sido eliminado.' - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) - video_urls = [] - data = httptools.downloadpage(page_url).data - text_encode = scrapertools.find_single_match(data, "(eval\(function\(p,a,c,k,e,d.*?)") - text_decode = aadecode(text_encode) - patron = "'([^']+)'" - media_url = scrapertools.find_single_match(text_decode, patron) - video_urls.append([media_url[-4:] + " [Videowood]", media_url]) - return video_urls diff --git a/plugin.video.alfa/servers/vidgg.json b/plugin.video.alfa/servers/vidgg.json deleted file mode 100755 index 37e9820f..00000000 --- a/plugin.video.alfa/servers/vidgg.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(?:vidgg.to|vid.gg)/(?:embed/|video/)([a-z0-9]+)", - "url": "http://vidgg.to/video/\\1" - } - ] - }, - "free": true, - "id": "vidgg", - "name": "vidgg", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ] -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/vidgg.py b/plugin.video.alfa/servers/vidgg.py deleted file mode 100755 index bee86e1e..00000000 --- a/plugin.video.alfa/servers/vidgg.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- - -from core import httptools -from core import jsontools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = jsontools.load(httptools.downloadpage("http://www.vidgg.to/api-v2/alive.php?link=" + page_url).data) - if data["data"] == "NOT_FOUND" or data["data"] == "FAILED": - return False, "[Vidgg] El archivo no existe o ha sido borrado" - elif data["data"] == "CONVERTING": - return False, "[Vidgg] El archivo se está procesando" - else: - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - - video_urls = [] - data = httptools.downloadpage(page_url).data - - mediaurls = scrapertools.find_multiple_matches(data, '(eval\(function.*?)") - data_js = jsunpack.unpack(data_js) - - mediaurls = scrapertools.find_multiple_matches(data_js, '\{file\s*:\s*"([^"]+)"\}') - - video_urls = [] - for mediaurl in mediaurls: - ext = scrapertools.get_filename_from_url(mediaurl)[-4:] - if "mp4" not in ext and "m3u8" not in ext: - continue - video_urls.append([ext + " [vidgot]", mediaurl]) - - return video_urls diff --git a/plugin.video.alfa/servers/vidlox.json b/plugin.video.alfa/servers/vidlox.json index e5774ed9..12c4c071 100644 --- a/plugin.video.alfa/servers/vidlox.json +++ b/plugin.video.alfa/servers/vidlox.json @@ -1,42 +1,42 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(?i)(https://vidlox.(?:tv|me)/embed-.*?.html)", - "url": "\\1" - } - ] - }, - "free": true, - "id": "vidlox", - "name": "vidlox", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "https://s1.postimg.cc/wathgtvin/logo-vidlox1.png" -} +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "(?i)(https://vidlox.(?:tv|me)/embed-.*?.html)", + "url": "\\1" + } + ] + }, + "free": true, + "id": "vidlox", + "name": "vidlox", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "@60654", + "type": "bool", + "visible": true + }, + { + "default": 0, + "enabled": true, + "id": "favorites_servers_list", + "label": "@60655", + "lvalues": [ + "No", + "1", + "2", + "3", + "4", + "5" + ], + "type": "list", + "visible": false + } + ], + "thumbnail": "https://s1.postimg.cc/wathgtvin/logo-vidlox1.png" +} diff --git a/plugin.video.alfa/servers/vidzella.json b/plugin.video.alfa/servers/vidzella.json deleted file mode 100644 index e84d80bf..00000000 --- a/plugin.video.alfa/servers/vidzella.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "https://vidzella.me/e/([a-zA-Z0-9]+)", - "url": "https://vidzella.me/e/\\1" - } - ] - }, - "free": true, - "id": "vidzella", - "name": "vidzella", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "https://s15.postimg.cc/albqao5pn/vidzella.png" -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/vidzella.py b/plugin.video.alfa/servers/vidzella.py deleted file mode 100644 index a83b1b66..00000000 --- a/plugin.video.alfa/servers/vidzella.py +++ /dev/null @@ -1,33 +0,0 @@ -# Conector Vidzella By Alfa development Group -# -------------------------------------------------------- - -import re -from core import httptools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - data = httptools.downloadpage(page_url) - - if data.code == 404: - return False, "[Vidzella] El archivo no existe o ha sido borrado" - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) - - video_urls = [] - data = httptools.downloadpage(page_url).data - data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) - logger.debug(data) - patron = "src=([^ ]+) type='.*?/(.*?)'" - matches = re.compile(patron, re.DOTALL).findall(data) - - for url, type in matches: - video_urls.append(['vidzella %s' % type, url]) - - return video_urls diff --git a/plugin.video.alfa/servers/watchers.json b/plugin.video.alfa/servers/watchers.json deleted file mode 100755 index 726b6510..00000000 --- a/plugin.video.alfa/servers/watchers.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "watchers.to/(?:embed-|)([A-z0-9]+)", - "url": "http://watchers.to/embed-\\1.html" - } - ] - }, - "free": true, - "id": "watchers", - "name": "watchers", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "http://i.imgur.com/WApzSMn.png?1" -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/watchers.py b/plugin.video.alfa/servers/watchers.py deleted file mode 100755 index 286afa86..00000000 --- a/plugin.video.alfa/servers/watchers.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- - -from core import httptools -from core import scrapertools -from lib import jsunpack -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - - data = httptools.downloadpage(page_url).data - if "File Not Found" in data: - return False, "[Watchers] El archivo no existe o ha sido borrado" - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=%s" % page_url) - video_urls = [] - - data = httptools.downloadpage(page_url).data - packed = scrapertools.find_single_match(data, '(eval\(function\(p,a,c,k,e.*?)').strip() - unpack = jsunpack.unpack(packed) - - bloque = scrapertools.find_single_match(unpack, 'sources:\[(.*?)\}\]') - matches = scrapertools.find_multiple_matches(bloque, 'file:"([^"]+)"(?:,label:"([^"]+)"|\})') - for media_url, calidad in matches: - ext = scrapertools.get_filename_from_url(media_url)[-4:] - if calidad: - ext += " " + calidad + "p" - media_url += "|Referer=%s" % page_url - video_urls.append([ext + ' [watchers]', media_url]) - - return video_urls diff --git a/plugin.video.alfa/servers/watchvideo.py b/plugin.video.alfa/servers/watchvideo.py index 43bea8fc..d38c039e 100755 --- a/plugin.video.alfa/servers/watchvideo.py +++ b/plugin.video.alfa/servers/watchvideo.py @@ -18,8 +18,13 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= logger.info("url=" + page_url) video_urls = [] data = httptools.downloadpage(page_url).data - media_urls = scrapertools.find_multiple_matches(data, 'file:"([^"]+)"') + packed = scrapertools.find_single_match(data, "text/javascript'>(.*?)\s*") + unpacked = jsunpack.unpack(packed) + media_urls = scrapertools.find_multiple_matches(unpacked, 'file:"([^"]+)"') for media_url in media_urls: + media_url += "|Referer=%s" %page_url + if ".png" in media_url: + continue ext = "mp4" if "m3u8" in media_url: ext = "m3u8" diff --git a/plugin.video.alfa/servers/wholecloud.json b/plugin.video.alfa/servers/wholecloud.json deleted file mode 100755 index 1faa1ab1..00000000 --- a/plugin.video.alfa/servers/wholecloud.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "wholecloud.net/(?:video/|embed/?v=)([A-z0-9]+)", - "url": "http://wholecloud.net/embed/?v=\\1" - } - ] - }, - "free": true, - "id": "wholecloud", - "name": "wholecloud", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "http://i.imgur.com/yIAQurm.png" -} \ No newline at end of file diff --git a/plugin.video.alfa/servers/wholecloud.py b/plugin.video.alfa/servers/wholecloud.py deleted file mode 100755 index 5905f9d2..00000000 --- a/plugin.video.alfa/servers/wholecloud.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- - -from core import httptools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - - if "This file no longer exists on our servers" in data: - return False, "[wholecloud] El archivo ha sido eliminado o no existe" - if "This video is not yet ready" in data: - return False, "[wholecloud] El archivo no está listo, se está subiendo o convirtiendo" - - return True, "" - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) - - data = httptools.downloadpage(page_url).data - - video_urls = [] - media_urls = scrapertools.find_multiple_matches(data, ' Date: Sat, 1 Sep 2018 15:58:06 -0300 Subject: [PATCH 02/18] cumlouder:fix --- plugin.video.alfa/channels/cumlouder.py | 30 ++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) mode change 100755 => 100644 plugin.video.alfa/channels/cumlouder.py diff --git a/plugin.video.alfa/channels/cumlouder.py b/plugin.video.alfa/channels/cumlouder.py old mode 100755 new mode 100644 index 76b13e79..81a26a7f --- a/plugin.video.alfa/channels/cumlouder.py +++ b/plugin.video.alfa/channels/cumlouder.py @@ -18,6 +18,7 @@ def mainlist(item): itemlist.append(item.clone(title="Últimos videos", action="videos", url="https://www.cumlouder.com/")) itemlist.append(item.clone(title="Categorias", action="categorias", url="https://www.cumlouder.com/categories/")) itemlist.append(item.clone(title="Pornstars", action="pornstars_list", url="https://www.cumlouder.com/girls/")) + itemlist.append(item.clone(title="Listas", action="series", url="https://www.cumlouder.com/series/")) itemlist.append(item.clone(title="Buscar", action="search", url="https://www.cumlouder.com/search?q=%s")) return itemlist @@ -82,10 +83,8 @@ def categorias(item): itemlist = [] data = get_data(item.url) - # logger.info("channels.cumlouder data="+data) - patron = '
[^<]+' - patron += '([^"]+)' - + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '([^<]+)' matches = re.compile(patron, re.DOTALL).findall(data) for url, title, thumbnail, count in matches: if "go.php?" in url: @@ -109,6 +108,28 @@ def categorias(item): return itemlist +def series(item): + logger.info() + itemlist = [] + + data = get_data(item.url) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '([^<]+).*?p>([^<]+)

' + matches = re.compile(patron, re.DOTALL).findall(data) + for url, thumbnail, title, count in matches: + itemlist.append( + item.clone(title="%s (%s) " % (title, count), url=urlparse.urljoin(item.url, url), action="videos", thumbnail=thumbnail)) + + # Paginador + matches = re.compile('Next[^<]+', re.DOTALL).findall(data) + if matches: + if "go.php?" in matches[0]: + url = urllib.unquote(matches[0].split("/go.php?u=")[1].split("&")[0]) + else: + url = urlparse.urljoin(item.url, matches[0]) + itemlist.append(item.clone(title="Pagina Siguiente", url=url)) + + return itemlist def videos(item): logger.info() @@ -116,7 +137,6 @@ def videos(item): data = get_data(item.url) patron = '
([^<]+)' - matches = re.compile(patron, re.DOTALL).findall(data) for url, title, thumbnail, duration in matches: if "go.php?" in url: From 9931d2864f0c70201467cddad8b4e3b8415331b5 Mon Sep 17 00:00:00 2001 From: chivmalev Date: Sat, 1 Sep 2018 17:02:17 -0300 Subject: [PATCH 03/18] porntrex: correcciones --- plugin.video.alfa/channels/porntrex.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 plugin.video.alfa/channels/porntrex.py diff --git a/plugin.video.alfa/channels/porntrex.py b/plugin.video.alfa/channels/porntrex.py old mode 100755 new mode 100644 index 38f59a3b..096c4eb7 --- a/plugin.video.alfa/channels/porntrex.py +++ b/plugin.video.alfa/channels/porntrex.py @@ -73,12 +73,14 @@ def lista(item): scrapedthumbnail = urlparse.urljoin(host, scrapedthumbnail) else: scrapedurl = urlparse.urljoin(host, scrapedurl) + if not scrapedthumbnail.startswith("https"): + scrapedthumbnail = "https:%s" % scrapedthumbnail if duration: scrapedtitle = "%s - %s" % (duration, scrapedtitle) if '>HD<' in quality: scrapedtitle += " [COLOR red][HD][/COLOR]" - itemlist.append(item.clone(action=action, title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, + itemlist.append(item.clone(action=action, title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, contentThumbnail=scrapedthumbnail, fanart=scrapedthumbnail)) # Extrae la marca de siguiente página @@ -128,6 +130,8 @@ def categorias(item): scrapedthumbnail = urllib.unquote(scrapedthumbnail.split("/go.php?u=")[1].split("&")[0]) else: scrapedurl = urlparse.urljoin(host, scrapedurl) + if not scrapedthumbnail.startswith("https"): + scrapedthumbnail = "https:%s" % scrapedthumbnail if videos: scrapedtitle = "%s (%s)" % (scrapedtitle, videos) itemlist.append(item.clone(action="lista", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, @@ -161,6 +165,8 @@ def playlists(item): scrapedthumbnail = urlparse.urljoin(host, scrapedthumbnail) else: scrapedurl = urlparse.urljoin(host, scrapedurl) + if not scrapedthumbnail.startswith("https"): + scrapedthumbnail = "https:%s" % scrapedthumbnail if videos: scrapedtitle = "%s (%s)" % (scrapedtitle, videos) itemlist.append(item.clone(action="videos", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, From d38c01fd089e8d7d613de7e6d0ae4d052b1058d3 Mon Sep 17 00:00:00 2001 From: angedam <37449358+thedoctor66@users.noreply.github.com> Date: Mon, 3 Sep 2018 19:16:32 +0200 Subject: [PATCH 04/18] small fix --- plugin.video.alfa/servers/thevideome.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/servers/thevideome.py b/plugin.video.alfa/servers/thevideome.py index 99f1bc10..559b4cb0 100755 --- a/plugin.video.alfa/servers/thevideome.py +++ b/plugin.video.alfa/servers/thevideome.py @@ -3,7 +3,7 @@ import urllib from core import httptools from core import scrapertools -from platformcode import logger +from platformcode import logger, config def test_video_exists(page_url): @@ -18,7 +18,7 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) video_urls = [] - post= {} + post = {} post = urllib.urlencode(post) if not "embed" in page_url: page_url = page_url.replace("https://thevideo.me/", "https://thevideo.me/embed-") + ".html" From 5667f89587b06a6874a6cc81e9bcd867549ac76d Mon Sep 17 00:00:00 2001 From: chivmalev Date: Mon, 3 Sep 2018 20:24:52 -0300 Subject: [PATCH 05/18] porntrex fix --- plugin.video.alfa/channels/porntrex.py | 40 ++++++++++---------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/plugin.video.alfa/channels/porntrex.py b/plugin.video.alfa/channels/porntrex.py index 096c4eb7..b4d4803c 100644 --- a/plugin.video.alfa/channels/porntrex.py +++ b/plugin.video.alfa/channels/porntrex.py @@ -152,10 +152,8 @@ def categorias(item): def playlists(item): logger.info() itemlist = [] - # Descarga la pagina data = get_data(item.url) - # Extrae las entradas patron = '
([^<]+)<' matches = scrapertools.find_multiple_matches(data, patron) @@ -168,11 +166,10 @@ def playlists(item): if not scrapedthumbnail.startswith("https"): scrapedthumbnail = "https:%s" % scrapedthumbnail if videos: - scrapedtitle = "%s (%s)" % (scrapedtitle, videos) + scrapedtitle = "%s [COLOR red](%s)[/COLOR]" % (scrapedtitle, videos) itemlist.append(item.clone(action="videos", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, fanart=scrapedthumbnail)) - - # Extrae la marca de siguiente página + #Extrae la marca de siguiente página next_page = scrapertools.find_single_match(data, '
  • (.*?)<\/li>' matches = re.compile(patron, re.DOTALL).findall(data) @@ -316,7 +324,7 @@ def findvideos(item): url = server_url[server_id] + video_id + '.html' elif server_id == 'BitTorrent': import urllib - base_url = 'http://www.cinecalidad.to/protect/v.php' + base_url = '%sprotect/v.php' % host post = {'i':video_id, 'title':item.title} post = urllib.urlencode(post) headers = {'Referer':item.url} @@ -330,9 +338,9 @@ def findvideos(item): if server_id not in ['Mega', 'MediaFire', 'Trailer']: if server != 'torrent': - language = IDIOMAS[item.language] + language = IDIOMAS[lang] else: - language = [IDIOMAS[item.language], 'vose'] + language = [IDIOMAS[lang], 'vose'] if url not in duplicados: new_item = Item(channel=item.channel, action='play', @@ -426,6 +434,6 @@ def newest(categoria): def search(item, texto): logger.info() texto = texto.replace(" ", "-") - item.url = host + '/?s=' + texto + item.url = item.host + '?s=' + texto if texto != '': return peliculas(item) From 62404eabfb75d5c8cd5bee1f0e8803aea995bbed Mon Sep 17 00:00:00 2001 From: pipcat Date: Wed, 5 Sep 2018 09:41:13 +0200 Subject: [PATCH 09/18] Pepecine y normalizar vose en json de canales --- plugin.video.alfa/channels/crunchyroll.json | 2 +- plugin.video.alfa/channels/dospelis.json | 2 +- plugin.video.alfa/channels/pelisr.json | 3 +- plugin.video.alfa/channels/pepecine.py | 158 ++++++++++++-------- plugin.video.alfa/channels/poseidonhd.json | 3 +- plugin.video.alfa/channels/poseidonhd.py | 2 +- plugin.video.alfa/channels/sipeliculas.json | 2 +- plugin.video.alfa/channels/wikiseries.json | 5 +- 8 files changed, 103 insertions(+), 74 deletions(-) mode change 100755 => 100644 plugin.video.alfa/channels/pepecine.py diff --git a/plugin.video.alfa/channels/crunchyroll.json b/plugin.video.alfa/channels/crunchyroll.json index 4005976e..f4341d45 100755 --- a/plugin.video.alfa/channels/crunchyroll.json +++ b/plugin.video.alfa/channels/crunchyroll.json @@ -2,7 +2,7 @@ "id": "crunchyroll", "name": "Crunchyroll", "language": ["cast", "lat"], - "active": false, + "active": true, "adult": false, "thumbnail": "http://i.imgur.com/O49fDS1.png", "categories": [ diff --git a/plugin.video.alfa/channels/dospelis.json b/plugin.video.alfa/channels/dospelis.json index 9a9dc8d9..13130b10 100644 --- a/plugin.video.alfa/channels/dospelis.json +++ b/plugin.video.alfa/channels/dospelis.json @@ -3,7 +3,7 @@ "name": "DosPelis", "active": true, "adult": false, - "language": ["lat", "cast", "vose"], + "language": ["lat", "cast"], "thumbnail": "https://www.dospelis.com/wp-content/uploads/2018/07/dospelislogo.png", "banner": "", "categories": [ diff --git a/plugin.video.alfa/channels/pelisr.json b/plugin.video.alfa/channels/pelisr.json index 92257e9e..6f50ccfe 100644 --- a/plugin.video.alfa/channels/pelisr.json +++ b/plugin.video.alfa/channels/pelisr.json @@ -3,12 +3,13 @@ "name": "PelisR", "active": true, "adult": false, - "language": ["lat", "cast", "vose"], + "language": ["lat", "cast"], "thumbnail": "https://s22.postimg.cc/gcp2jqbs1/pelisr.png", "banner": "", "categories": [ "movie", "tvshow", + "vos", "direct" ], "settings": [ diff --git a/plugin.video.alfa/channels/pepecine.py b/plugin.video.alfa/channels/pepecine.py old mode 100755 new mode 100644 index 72bb3424..fd3d6986 --- a/plugin.video.alfa/channels/pepecine.py +++ b/plugin.video.alfa/channels/pepecine.py @@ -17,7 +17,7 @@ from channels import filtertools host = "https://pepecine.io" -IDIOMAS = {'es': 'Español', 'en': 'Inglés', 'la': 'Latino', 'su': 'VOSE', 'vo': 'VO', 'otro': 'OVOS'} +IDIOMAS = {'c': 'Castellano', 'i': 'Inglés', 'l': 'Latino', 's': 'VOSE', 'v': 'VO'} list_idiomas = IDIOMAS.values() list_language = ['default'] @@ -46,7 +46,7 @@ def mainlist(item): itemlist.append(Item(title = "Series")) - itemlist.append(item.clone(title = " Últimas series", + itemlist.append(item.clone(title = " Últimos episodios", url = host + '/las-series-online', action = 'list_latest', type = 'series')) @@ -151,10 +151,12 @@ def list_latest(item): itemlist = [] data = get_source(item.url) data_url= scrapertools.find_single_match(data,'= item.indexp + perpage: - break; + isDD, language = _extraer_dd_idioma(language) + if isDD: + continue + + repe = False + for it in itemlist: + if it.url == host + url: + repe = True + break + if repe: + continue path = scrapertools.find_single_match(thumbnail, "w\w+(/\w+.....)") filtro_list = {"poster_path": path} filtro_list = filtro_list.items() - itemlist.append(item.clone(action = 'findvideos', - title = title, - url = host + url, - thumbnail = thumbnail, - language = language, - infoLabels = {'filtro': filtro_list}, - ) - ) + + new_item = item.clone(action = 'findvideos', + title = title, + url = host + url, + thumbnail = thumbnail, + language = language, + infoLabels = {'filtro': filtro_list, 'year': '-'} + ) + + if item.type == 'series': + new_item.contentType = 'episode' + season_episode = scrapertools.find_single_match(title, ' (\d+)x(\d+)') + if season_episode: + new_item.contentSeason = season_episode[0] + new_item.contentEpisodeNumber = season_episode[1] + new_item.contentSerieName = re.sub(r' \d+x\d+', '', title).strip() + else: + new_item.contentSerieName = title + else: + new_item.contentType = 'movie' + new_item.contentTitle = title + + itemlist.append(new_item) + + if len(itemlist) >= perpage: + break; + tmdb.set_infoLabels(itemlist) # Desde novedades no tenemos el elemento item.channel - if item.channel: - itemlist.append(item.clone(title = "Página siguiente >>>", - indexp = item.indexp + perpage - ) - ) - if item.indexp > 1: - itemlist.append(item.clone(title = "<<< Página anterior", - indexp = item.indexp - perpage - ) - ) + if item.channel and len(itemlist) >= perpage and count + 1 <= len(matches): + itemlist.append( item.clone(title = "Página siguiente >>>", indexp = count + 1) ) return itemlist @@ -200,7 +222,7 @@ def list_all(item): item.page = 1 genero = scrapertools.find_single_match(item.url, "genre=(\w+)") - data= get_source(item.url) + data = get_source(item.url) token = scrapertools.find_single_match(data, "token:.*?'(.*?)'") url = host+'/titles/paginate?_token=%s&perPage=%d&page=%d&order=mc_num_of_votesDesc&type=%s&minRating=&maxRating=&availToStream=1&genres[]=%s' % (token, perpage, item.page, item.type, genero) data = httptools.downloadpage(url).data @@ -225,6 +247,7 @@ def list_all(item): if item.type == 'movie': new_item.action = 'findvideos' + new_item.contentType = 'movie' new_item.contentTitle = element['title'] new_item.fulltitle = element['title'] if new_item.extra != "links_encoded": @@ -234,6 +257,8 @@ def list_all(item): new_item.action = 'seasons' new_item.url = host + "/ver-serie-tv/" + str(element['id']) new_item.show = element['title'] + new_item.contentType = 'tvshow' + new_item.contentSerieName = element['title'] itemlist.append(new_item) @@ -242,10 +267,6 @@ def list_all(item): itemlist.append(item.clone(title = 'Página siguiente >>>', page = item.page + 1)) - if (int(item.page) > 1): - itemlist.append(item.clone(title = '<<< Página anterior', - page = item.page - 1)) - return itemlist def episodios(item): @@ -262,17 +283,22 @@ def episodios(item): def seasons(item): logger.info() + itemlist=[] + data = httptools.downloadpage(item.url).data reSeasons = re.findall("href *= *[\"']([^\"']+)[\"'][^\"']+[\"']sezon[^>]+>([^<]+)+", data) - - itemlist = [item.clone(action = "seasons_episodes", - title = title, - url = url) for url, title in reSeasons] + for url, title in reSeasons: + new_item = item.clone(action = "seasons_episodes", title = title, url = url) + new_item.contentType = 'season' + new_item.contentSeason = title.replace('Temporada', '').strip() + itemlist.append(new_item) if len(itemlist) == 1: itemlist = seasons_episodes(itemlist[0]) + tmdb.set_infoLabels(itemlist) + # Opción "Añadir esta serie a la videoteca de XBMC" if config.get_videolibrary_support() and len(itemlist) > 0: itemlist.append(item.clone(title="Añadir esta serie a la videoteca", action="add_serie_to_library", extra="episodios")) @@ -281,16 +307,25 @@ def seasons(item): def seasons_episodes(item): logger.info() + itemlist=[] data = httptools.downloadpage(item.url).data - reEpisodes = re.findall("]+col-sm-3[^>]+href *= *[\"'](?P[^\"']+).*?]+src *= *[\"'](?P[^\"']+).*?]+>(?P.*?)</a>", data, re.MULTILINE | re.DOTALL) - seasons = [item.clone(action = "findvideos", - title = re.sub("<b>Episodio (\d+)</b> - T(\d+) \|[^\|]*\| ".format(item.show), "\g<2>x\g<1> - ", title), - thumbnail = thumbnail, - url = url) for url, thumbnail, title in reEpisodes] + reEpisodes = re.findall('<li class="media bord">(.*?)</li>', data, re.MULTILINE | re.DOTALL) + for epi in reEpisodes: + new_item = item.clone(action = "findvideos") + new_item.url = scrapertools.find_single_match(epi, ' href="([^"]*)') + new_item.thumbnail = scrapertools.find_single_match(epi, ' src="([^"]*)') + new_item.contentType = 'episode' + new_item.contentEpisodeNumber = scrapertools.find_single_match(epi, '<b>Episodio (\d+)</b>') + title = scrapertools.find_single_match(epi, '<b>Episodio \d+</b> - T\d+ \|[^\|]*\| ([^<]*)').strip() + new_item.title = '%sx%s - %s' % (str(item.contentSeason), str(new_item.contentEpisodeNumber), title) + + itemlist.append(new_item) - return seasons + tmdb.set_infoLabels(itemlist) + + return itemlist def findvideos(item): @@ -298,28 +333,17 @@ def findvideos(item): itemlist=[] if item.extra != "links_encoded": - - # data = httptools.downloadpage(item.url).data - # linksRE = re.findall("getFavicon\('(?P<url>[^']+)[^>]+>[^>]+>(?P<language>[^<]+).+?<td[^>]+>(?P<quality>[^<]*).+?<td[^>]+>(?P<antiquity>[^<]*)", data, re.MULTILINE | re.DOTALL) - # for url, language, quality, antiquity in linksRE: - # logger.info("URL = " + url); - - data = httptools.downloadpage(item.url).data - patron = "renderTab.bind.*?'([^']+).*?" - patron += "app.utils.getFavicon.*?<img [^>]*src *= *[\"']/([^\.]+).*?" - patron += 'color:#B1FFC5;">([^<]+)' + patron = "renderTab\.bind.*?'([^']+)" + patron += '.*?<img data-bind="[^"]+"><b>([^<]*)' + patron += '.*?<td [^>]*>([^<]*)' + patron += '.*?<td [^>]*>([^<]*)' + matches = scrapertools.find_multiple_matches(data, patron) - for scrapedurl, language, scrapedquality in matches: - isDD = language.startswith("z") - if isDD: - language = language[1:] - - language = language[0:2] - language = IDIOMAS.get(language, language) - - title = ("Ver" if not isDD else "Descargar") + " enlace en %s [" + language + "] [" + scrapedquality + "]" + for scrapedurl, language, scrapedquality, scrapedwhen in matches: + isDD, language = _extraer_dd_idioma(language) if not isDD: + title = "%s [" + language + "] [" + scrapedquality + "] [" + scrapedwhen + "]" itemlist.append(item.clone(action = 'play', title = title, url = scrapedurl, @@ -327,22 +351,17 @@ def findvideos(item): ) ) itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) + else: for link in item.url: - - language = scrapertools.find_single_match(link['label'], '/([^\.]+)') - isDD = language.startswith("z") - if isDD: - language = language[1:] - - language = language[0:2] - + isDD, language = _extraer_dd_idioma(link['label']) if not isDD: itemlist.append(item.clone(action='play', title = item.title, url= link['url'], - language=IDIOMAS.get(language, language), + language=language, quality=link['quality'])) + itemlist=servertools.get_servers_itemlist(itemlist) for videoitem in itemlist: videoitem.title = '%s [%s] [%s]' % (videoitem.server.capitalize(), videoitem.language, videoitem.quality) @@ -365,3 +384,10 @@ def findvideos(item): def play(item): item.thumbnail = item.contentThumbnail return [item] + +# idiomas: l, c, s, i, v (lat, cast, subt, inglés, vo). Si empieza por z es descarga directa +def _extraer_dd_idioma(lang): + lang = lang.strip().lower() + isDD = lang.startswith('z') + lg = lang[1] if isDD else lang[0] + return isDD, IDIOMAS.get(lg, lang) diff --git a/plugin.video.alfa/channels/poseidonhd.json b/plugin.video.alfa/channels/poseidonhd.json index 07337f2f..1f4d4d48 100644 --- a/plugin.video.alfa/channels/poseidonhd.json +++ b/plugin.video.alfa/channels/poseidonhd.json @@ -3,12 +3,13 @@ "name": "PoseidonHD", "active": true, "adult": false, - "language": ["lat", "vose"], + "language": ["lat"], "thumbnail": "https://poseidonhd.com/wp-content/uploads/2017/06/logo2.png", "banner": "", "categories": [ "movie", "tvshow", + "vos", "direct" ], "settings": [ diff --git a/plugin.video.alfa/channels/poseidonhd.py b/plugin.video.alfa/channels/poseidonhd.py index b3945d79..b4c8d547 100644 --- a/plugin.video.alfa/channels/poseidonhd.py +++ b/plugin.video.alfa/channels/poseidonhd.py @@ -17,7 +17,7 @@ from channels import autoplay from platformcode import config, logger -IDIOMAS = {'mx': 'Latino', 'dk':'Latino', 'es': 'Castellano', 'en': 'VOSE', 'gb':'VOSE'} +IDIOMAS = {'mx': 'Latino', 'dk':'Latino', 'es': 'Castellano', 'en': 'VOSE', 'gb':'VOSE', 'de':'Alemán'} list_language = IDIOMAS.values() list_quality = ['HD', 'SD', 'CAM'] diff --git a/plugin.video.alfa/channels/sipeliculas.json b/plugin.video.alfa/channels/sipeliculas.json index 2f472705..487a8dd7 100755 --- a/plugin.video.alfa/channels/sipeliculas.json +++ b/plugin.video.alfa/channels/sipeliculas.json @@ -3,7 +3,7 @@ "name": "SiPeliculas", "active": true, "adult": false, - "language": "[lat]", + "language": ["lat"], "banner": "https://s24.postimg.cc/5wcznkxhv/sipeliculas.png", "thumbnail": "https://s23.postimg.cc/adrl2k5mz/sipeliculas.png", "categories": [ diff --git a/plugin.video.alfa/channels/wikiseries.json b/plugin.video.alfa/channels/wikiseries.json index d0cf2aee..ba783c43 100644 --- a/plugin.video.alfa/channels/wikiseries.json +++ b/plugin.video.alfa/channels/wikiseries.json @@ -3,11 +3,12 @@ "name": "WikiSeries", "active": true, "adult": false, - "language": ["lat", "cast", "vo", "vose"], + "language": ["lat", "cast"], "thumbnail": "https://s31.postimg.cc/tnmcrytnv/16142379_1847422438815031_3788419094563167644_n.jpg", "banner": "", "categories": [ - "tvshow" + "tvshow", + "vos" ], "settings": [ { From d4e49347c4447ce6dbba63bf7cea9b8615d58147 Mon Sep 17 00:00:00 2001 From: chivmalev <lbivan187@gmail.com> Date: Wed, 5 Sep 2018 11:59:33 -0300 Subject: [PATCH 10/18] porntrex fix --- plugin.video.alfa/channels/porntrex.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/porntrex.py b/plugin.video.alfa/channels/porntrex.py index b4d4803c..17387bea 100644 --- a/plugin.video.alfa/channels/porntrex.py +++ b/plugin.video.alfa/channels/porntrex.py @@ -10,6 +10,7 @@ from core.item import Item from platformcode import config, logger host = "https://www.porntrex.com" +perpage = 20 def mainlist(item): @@ -183,6 +184,8 @@ def playlists(item): def videos(item): logger.info() + if not item.indexp: + item.indexp = 1 itemlist = [] # Descarga la pagina data = get_data(item.url) @@ -190,9 +193,13 @@ def videos(item): if config.get_setting("menu_info", "porntrex"): action = "menu_info" # Extrae las entradas - patron = '<div class="video-item.*?href="([^"]+)".*?title="([^"]+)".*?src="([^"]+)".*?class="hd(.*?)<div class="durations">.*?</i>([^<]+)</div>' + patron = '<div class="video-item.*?href="([^"]+)".*?title="([^"]+)".*?src="([^"]+)"(.*?)<div class="durations">.*?</i>([^<]+)</div>' matches = scrapertools.find_multiple_matches(data, patron) + count = 0 for scrapedurl, scrapedtitle, scrapedthumbnail, quality, duration in matches: + count += 1 + if count < item.indexp: + continue if "go.php?" in scrapedurl: scrapedurl = urllib.unquote(scrapedurl.split("/go.php?u=")[1].split("&")[0]) scrapedthumbnail = urlparse.urljoin(host, scrapedthumbnail) @@ -204,8 +211,14 @@ def videos(item): scrapedtitle = "%s - %s" % (duration, scrapedtitle) if '>HD<' in quality: scrapedtitle += " [COLOR red][HD][/COLOR]" + if len(itemlist) >= perpage: + break; itemlist.append(item.clone(action=action, title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, contentThumbnail=scrapedthumbnail, fanart=scrapedthumbnail)) + #Extrae la marca de siguiente página + if item.channel and len(itemlist) >= perpage: + itemlist.append( item.clone(title = "Página siguiente >>>", indexp = count + 1) ) + return itemlist def play(item): From 13ab21bff27b9c0880d04d9591c592f0b019269d Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Wed, 5 Sep 2018 18:04:08 +0200 Subject: [PATCH 11/18] =?UTF-8?q?Mejoras=20de=20c=C3=B3digo=20e=20Idiomas?= =?UTF-8?q?=20en=20.jsons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/divxtotal.py | 20 +- plugin.video.alfa/channels/elitetorrent.json | 2 +- plugin.video.alfa/channels/elitetorrent.py | 88 +++--- plugin.video.alfa/channels/estrenosgo.json | 5 +- plugin.video.alfa/channels/estrenosgo.py | 178 ++++++------ plugin.video.alfa/channels/grantorrent.json | 5 +- plugin.video.alfa/channels/grantorrent.py | 178 ++++++------ plugin.video.alfa/channels/mejortorrent1.json | 5 +- plugin.video.alfa/channels/mejortorrent1.py | 254 ++++++++++-------- 9 files changed, 398 insertions(+), 337 deletions(-) diff --git a/plugin.video.alfa/channels/divxtotal.py b/plugin.video.alfa/channels/divxtotal.py index 8b3ca25e..8e1ba213 100644 --- a/plugin.video.alfa/channels/divxtotal.py +++ b/plugin.video.alfa/channels/divxtotal.py @@ -100,14 +100,14 @@ def categorias(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos matches = re.compile(patron, re.DOTALL).findall(data) if not matches: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug(item.url_plus) #logger.debug(matches) @@ -173,7 +173,7 @@ def listado(item): cnt_tot = 40 # Poner el num. máximo de items por página cnt_title = 0 # Contador de líneas insertadas en Itemlist - inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable + inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable fin = inicio + 10 # Después de este tiempo pintamos (segundos) timeout_search = timeout # Timeout para descargas if item.extra == 'search': @@ -182,8 +182,8 @@ def listado(item): timeout_search = 5 # Timeout un poco más largo para las búsquedas #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios - title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas - if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item del item.title_lista # ... limpiamos @@ -206,7 +206,7 @@ def listado(item): if not data and not item.extra2: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #Patrón para todo, menos para Series completas, incluido búsquedas en cualquier caso patron = '<tr><td(?: class="[^"]+")?><a href="([^"]+)".?title="([^"]+)".*?<\/a><\/td><td(?: class="[^"]+")?>(?:<a href="[^"]+">)?(.*?)(?:<\/a>)?<\/td><td(?: class="[^"]+")?>.*?<\/td><td(?: class="[^"]+")?>(.*?)<\/td><\/tr>' @@ -224,7 +224,7 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -547,7 +547,7 @@ def episodios(item): itemlist = [] item.category = categoria - logger.debug(item) + #logger.debug(item) if item.from_title: item.title = item.from_title @@ -616,8 +616,8 @@ def episodios(item): itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - logger.debug("PATRON: " + patron) - logger.debug(matches) + #logger.debug("PATRON: " + patron) + #logger.debug(matches) #logger.debug(data) season = max_temp diff --git a/plugin.video.alfa/channels/elitetorrent.json b/plugin.video.alfa/channels/elitetorrent.json index 72705725..ec17889b 100644 --- a/plugin.video.alfa/channels/elitetorrent.json +++ b/plugin.video.alfa/channels/elitetorrent.json @@ -3,7 +3,7 @@ "name": "Elite Torrent", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "elitetorrent.png", "banner": "elitetorrent.png", "categories": [ diff --git a/plugin.video.alfa/channels/elitetorrent.py b/plugin.video.alfa/channels/elitetorrent.py index 0faf759c..6842c037 100644 --- a/plugin.video.alfa/channels/elitetorrent.py +++ b/plugin.video.alfa/channels/elitetorrent.py @@ -49,14 +49,14 @@ def submenu(item): if not data: logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #Algo no funciona, pintamos lo que tenemos + return itemlist #Algo no funciona, pintamos lo que tenemos - patron = '<div class="cab_menu">.*?<\/div>' #Menú principal + patron = '<div class="cab_menu">.*?<\/div>' #Menú principal data1 = scrapertools.get_match(data, patron) - patron = '<div id="menu_langen">.*?<\/div>' #Menú de idiomas + patron = '<div id="menu_langen">.*?<\/div>' #Menú de idiomas data1 += scrapertools.get_match(data, patron) - patron = '<a href="(.*?)".*?title="(.*?)"' #Encontrar todos los apartados + patron = '<a href="(.*?)".*?title="(.*?)"' #Encontrar todos los apartados matches = re.compile(patron, re.DOTALL).findall(data1) if not matches: item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada @@ -68,25 +68,25 @@ def submenu(item): logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data1) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: scrapedtitle = re.sub('\r\n', '', scrapedtitle).decode('utf8').strip() scrapedtitle = scrapedtitle.replace(" torrent", "").replace(" Torrent", "").replace("Series y ", "").title() - if "castellano" in scrapedtitle.lower(): #Evita la entrada de peliculas castellano del menú de idiomas + if "castellano" in scrapedtitle.lower(): #Evita la entrada de peliculas castellano del menú de idiomas continue - if item.extra == "series": #Tratamos Series + if item.extra == "series": #Tratamos Series if not "/serie" in scrapedurl: continue - else: #Tratamos Películas + else: #Tratamos Películas if "/serie" in scrapedurl: continue itemlist.append(item.clone(action="listado", title=scrapedtitle, url=scrapedurl)) - if item.extra == "series": #Añadimos Series VOSE que está fuera del menú principal + if item.extra == "series": #Añadimos Series VOSE que está fuera del menú principal itemlist.append(item.clone(action="listado", title="Series VOSE", url=host + "/series-vose/")) return itemlist @@ -103,24 +103,24 @@ def listado(item): except: pass - if not data: #Si la web está caída salimos sin dar error + if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '<div id="principal">.*?<\/nav><\/div><\/div>' data = scrapertools.find_single_match(data, patron) - patron = '<li>.*?<a href="(.*?)".*?' #url - patron += 'title="(.*?)".*?' #título - patron += 'src="(.*?)".*?' #thumb - patron += "title='(.*?)'.*?" #categoría, idioma - patron += '"><i>(.*?)<\/i><\/span.*?' #calidad - patron += '="dig1">(.*?)<.*?' #tamaño - patron += '="dig2">(.*?)<\/span><\/div>' #tipo tamaño + patron = '<li>.*?<a href="(.*?)".*?' #url + patron += 'title="(.*?)".*?' #título + patron += 'src="(.*?)".*?' #thumb + patron += "title='(.*?)'.*?" #categoría, idioma + patron += '"><i>(.*?)<\/i><\/span.*?' #calidad + patron += '="dig1">(.*?)<.*?' #tamaño + patron += '="dig2">(.*?)<\/span><\/div>' #tipo tamaño matches = re.compile(patron, re.DOTALL).findall(data) - if not matches and not '<title>503 Backend fetch failed' in data: #error + if not matches and not '503 Backend fetch failed' in data: #error item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Llamamos al método para el pintado del error @@ -128,21 +128,21 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) #logger.debug(data) for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedcategory, scrapedcalidad, scrapedsize, scrapedsizet in matches: - item_local = item.clone() #Creamos copia de Item para trabajar + item_local = item.clone() #Creamos copia de Item para trabajar title = re.sub('\r\n', '', scrapedtitle).decode('utf8').strip() title = title.replace(" torrent", "").replace(" Torrent", "").replace("Series y ", "") item_local.url = urlparse.urljoin(host, scrapedurl) item_local.thumbnail = urlparse.urljoin(host, scrapedthumbnail) - if "---" in scrapedcalidad: #limpiamos calidades + if "---" in scrapedcalidad: #limpiamos calidades scrapedcalidad = '' if "microhd" in title.lower(): item_local.quality = "microHD" @@ -158,7 +158,7 @@ def listado(item): else: item_local.quality += ' [%s %s]' % (scrapedsize.replace(".", ","), scrapedsizet) - item_local.language = [] #Verificamos el idioma por si encontramos algo + item_local.language = [] #Verificamos el idioma por si encontramos algo if "latino" in scrapedcategory.lower() or "latino" in item.url or "latino" in title.lower(): item_local.language += ["LAT"] if "ingles" in scrapedcategory.lower() or "ingles" in item.url or "vose" in scrapedurl or "vose" in item.url: @@ -175,7 +175,7 @@ def listado(item): title = re.sub(r'\??\s?\d*?\&.*', '', title).title().strip() item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título - if item_local.extra == "peliculas": #preparamos Item para películas + if item_local.extra == "peliculas": #preparamos Item para películas if "/serie" in scrapedurl or "/serie" in item.url: continue if not "/serie" in scrapedurl and not "/serie" in item.url: @@ -183,7 +183,7 @@ def listado(item): item_local.contentTitle = title item_local.extra = "peliculas" - if item_local.extra == "series": #preparamos Item para series + if item_local.extra == "series": #preparamos Item para series if not "/serie" in scrapedurl and not "/serie" in item.url: continue if "/serie" in scrapedurl or "/serie" in item.url: @@ -202,7 +202,7 @@ def listado(item): item_local.contentEpisodeNumber = 1 item_local.contentSerieName = title if epi_mult: - title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(epi_mult).zfill(2)) #Creamos un título con el rango de episodios + title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(epi_mult).zfill(2)) #Creamos un título con el rango de episodios else: title = '%sx%s ' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) @@ -214,7 +214,7 @@ def listado(item): if item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global, pasamos tmdb.set_infoLabels(item_local, True) - itemlist.append(item_local.clone()) #Pintar pantalla + itemlist.append(item_local.clone()) #Pintar pantalla #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo @@ -227,12 +227,12 @@ def listado(item): # Extrae el paginador patron = '
    .*?>": + if "Página siguiente >>" in itemlist[-1].title: itemlist.pop() # Se captura la excepción, para no interrumpir al canal novedades si un canal falla diff --git a/plugin.video.alfa/channels/estrenosgo.json b/plugin.video.alfa/channels/estrenosgo.json index 5e335051..bf922a70 100755 --- a/plugin.video.alfa/channels/estrenosgo.json +++ b/plugin.video.alfa/channels/estrenosgo.json @@ -3,7 +3,7 @@ "name": "EstrenosGo", "active": true, "adult": false, - "language": ["cast", "LAT", "VOSE", "VOS"], + "language": ["cast", "lat"], "fanart": "estrenosgo.png", "thumbnail": "estrenosgo.png", "banner": "estrenosgo.png", @@ -11,7 +11,8 @@ "movie", "tvshow", "torrent", - "direct" + "direct", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/estrenosgo.py b/plugin.video.alfa/channels/estrenosgo.py index 4036f3af..72cfa220 100644 --- a/plugin.video.alfa/channels/estrenosgo.py +++ b/plugin.video.alfa/channels/estrenosgo.py @@ -113,7 +113,7 @@ def categorias(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") matches = re.compile(patron, re.DOTALL).findall(data) @@ -121,7 +121,7 @@ def categorias(item): if not matches: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug(matches) @@ -182,7 +182,7 @@ def listado(item): cnt_tot = 40 # Poner el num. máximo de items por página cnt_title = 0 # Contador de líneas insertadas en Itemlist - inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable + inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable fin = inicio + 10 # Después de este tiempo pintamos (segundos) timeout_search = timeout # Timeout para descargas if item.extra == 'search': @@ -191,9 +191,9 @@ def listado(item): timeout_search = 5 # Timeout un poco más largo para las búsquedas #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios - title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas - if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada - title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item del item.title_lista # ... limpiamos if not item.extra2: # Si viene de Catálogo o de Alfabeto @@ -215,7 +215,12 @@ def listado(item): if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Patrón para todo menos para Series completas patron = '
    ' @@ -237,7 +242,12 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -253,9 +263,9 @@ def listado(item): except: last_page = 1 #Si no lo encuentra, lo ponemos a 1 - if item.extra == 'series': #Si son series completas, vamos a un listado especializado - item.matches = matches #salvamos todas las matches, no hay paginación - return listado_series(item) #llamamos a un método especializado + if item.extra == 'series': #Si son series completas, vamos a un listado especializado + item.matches = matches #salvamos todas las matches, no hay paginación + return listado_series(item) #llamamos a un método especializado #Empezamos el procesado de matches for scrapedurl, scrapedenlace, scrapedthumbnail, scrapedtitle, cat_ppal, cat_sec, opciones in matches: @@ -280,25 +290,25 @@ def listado(item): except: pass - if not data_serie: #Si la web está caída salimos sin dar error. Pintamos el episodio + if not data_serie: #Si la web está caída salimos sin dar error. Pintamos el episodio logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + scrapedurl + " / SERIE: " + cat_sec) else: patron_serie = '
    .*?.*?<\/a>.*?' url = scrapertools.find_single_match(data_serie, patron_serie) #buscamos la url de la serie completa if url: url = host + url - extra = 'series' #es una serie completa - title_lista += [cat_sec] #la añadimos a la lista de series completas procesadas - title = cat_sec #salvamos el título de la serie completa + extra = 'series' #es una serie completa + title_lista += [cat_sec] #la añadimos a la lista de series completas procesadas + title = cat_sec #salvamos el título de la serie completa else: - url = scrapedurl #No se encuentra la Serie, se trata como Episodio suelto + url = scrapedurl #No se encuentra la Serie, se trata como Episodio suelto - elif "Archivo Torrent" not in scrapedenlace and "Video Online" not in scrapedenlace: #Si no tiene enlaces pasamos + elif "Archivo Torrent" not in scrapedenlace and "Video Online" not in scrapedenlace: #Si no tiene enlaces pasamos continue cnt_title += 1 - item_local = item.clone() #Creamos copia de Item para trabajar - if item_local.tipo: #... y limpiamos + item_local = item.clone() #Creamos copia de Item para trabajar + if item_local.tipo: #... y limpiamos del item_local.tipo if item_local.totalItems: del item_local.totalItems @@ -317,18 +327,18 @@ def listado(item): item_local.text_color = True del item_local.text_color - title_subs = [] #creamos una lista para guardar info importante - item_local.language = [] #creamos lista para los idiomas - item_local.quality = '' #iniciamos calidad + title_subs = [] #creamos una lista para guardar info importante + item_local.language = [] #creamos lista para los idiomas + item_local.quality = '' #iniciamos calidad quality_alt = '' - if 'series' not in cat_ppal: #si no son series, contiene la calidad + if 'series' not in cat_ppal: #si no son series, contiene la calidad quality_alt = cat_sec.lower().strip() - item_local.extra = extra #guardamos el extra procesado - item_local.url = url #guardamos la url final - item_local.thumbnail = host[:-1] + scrapedthumbnail #guardamos el thumb + item_local.extra = extra #guardamos el extra procesado + item_local.url = url #guardamos la url final + item_local.thumbnail = host[:-1] + scrapedthumbnail #guardamos el thumb item_local.context = "['buscar_trailer']" - item_local.contentType = "movie" #por defecto, son películas + item_local.contentType = "movie" #por defecto, son películas item_local.action = "findvideos" #Analizamos los formatos de la películas @@ -347,7 +357,7 @@ def listado(item): elif item_local.extra == 'series': item_local.contentType = "tvshow" item_local.action = "episodios" - item_local.season_colapse = True #Muestra las series agrupadas por temporadas + item_local.season_colapse = True #Muestra las series agrupadas por temporadas elif 'series' in cat_ppal or item_local.extra == 'episodios': item_local.contentType = "episode" item_local.extra = "episodios" @@ -361,7 +371,7 @@ def listado(item): item_local.contentType = "season" item_local.extra = "season" - if item_local.contentType == "movie": #para las peliculas ponemos el mismo extra + if item_local.contentType == "movie": #para las peliculas ponemos el mismo extra item_local.extra = "peliculas" #Detectamos idiomas @@ -495,13 +505,13 @@ def listado_series(item): #logger.debug(item) #Control de paginación - matches = item.matches #Restauramos la matches de la primera pasada + matches = item.matches #Restauramos la matches de la primera pasada del item.matches - matches_tot = len(matches) #La web no pagina las Series, lo tenemos que controlar - if item.matches_current: #Llevamos los contadores de cuánto hemos pintado y cuánto queda + matches_tot = len(matches) #La web no pagina las Series, lo tenemos que controlar + if item.matches_current: #Llevamos los contadores de cuánto hemos pintado y cuánto queda matches_current = item.matches_current if matches_tot >= matches_current + pag: - item.matches_current = matches_current + pag #Establecemos el bloque a pintar en este pasada + item.matches_current = matches_current + pag #Establecemos el bloque a pintar en este pasada else: item.matches_current = matches_tot @@ -566,8 +576,8 @@ def listado_series(item): #logger.debug(item_local) - #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global - # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo + #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global + # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo #Pasamos a TMDB la lista completa Itemlist tmdb.set_infoLabels(itemlist, __modo_grafico__) @@ -607,7 +617,7 @@ def findvideos(item): if not data_torrent and not data_directo: logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '
    1 and (item.contentType == 'episode' or item.contentType == 'season'): itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios itemlist.extend(itemlist_alt) #Ahora tratamos los servidores directo itemlist_alt = [] if matches_directo: - for scrapedurl, scrapedquality, scrapedlang in matches_directo: #leemos los torrents con la diferentes calidades + for scrapedurl, scrapedquality, scrapedlang in matches_directo: #leemos los torrents con la diferentes calidades #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() - item_local.url = scrapedurl #Guardamos la url intermedia + item_local.url = scrapedurl #Guardamos la url intermedia item_local.quality = '' if scrapedquality: @@ -779,11 +789,11 @@ def findvideos(item): if not item_local.quality: item_local.quality = item.quality - elif scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración + elif scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración item_local.quality += ' [/COLOR][COLOR white]%s' % scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])') #Copiamos duración if scrapedlang in IDIOMAS: - item_local.language = ["%s" % IDIOMAS[scrapedlang]] #Salvamos el idioma, si lo hay + item_local.language = ["%s" % IDIOMAS[scrapedlang]] #Salvamos el idioma, si lo hay #Leemos la página con el enlace al Servidor try: @@ -797,7 +807,7 @@ def findvideos(item): if not data or not matches: logger.error("ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) - break #si no hay más datos, algo no funciona, pasamos a Ver Online + continue #si no hay más datos, algo no funciona, salimos #logger.debug(patron) #logger.debug(matches) @@ -862,14 +872,14 @@ def findvideos(item): #Verificamos el si el enlace del servidor está activo mostrar_server = True - if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran + if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran mostrar_server = servertools.is_server_enabled(servidor) - try: #Obtenemos el enlace + try: #Obtenemos el enlace if mostrar_server: - devuelve = servertools.findvideosbyserver(scrapedenlace, servidor) #existe el link ? + devuelve = servertools.findvideosbyserver(scrapedenlace, servidor) #existe el link ? if devuelve: - enlace = devuelve[0][1] #Se guarda el link + enlace = devuelve[0][1] #Se guarda el link if not enlace: continue @@ -877,21 +887,21 @@ def findvideos(item): #Si el link no está activo se ignora if "??" in item_local.alive: #dudoso item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) - elif "no" in item_local.alive.lower(): #No está activo. Lo preparo, pero no lo pinto + elif "no" in item_local.alive.lower(): #No está activo. Lo preparo, pero no lo pinto item_local.title = '[COLOR red][%s][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.alive, servidor.capitalize(), quality, str(item_local.language)) logger.debug(item_local.alive + ": ALIVE / " + servidor + " / " + enlace) raise - else: #Sí está activo + else: #Sí está activo item_local.title = '[COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) #Ahora pintamos el link Directo item_local.url = enlace item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos - item_local.action = "play" #Visualizar vídeo - item_local.server = servidor #Seridor Directo + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos + item_local.action = "play" #Visualizar vídeo + item_local.server = servidor #Seridor Directo - itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla + itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla except: logger.error('ERROR al procesar enlaces DIRECTOS: ' + servidor + ' / ' + scrapedenlace) @@ -901,7 +911,7 @@ def findvideos(item): #Si son múltiples episodios, ordenamos if len(itemlist_alt) > 1 and (item.contentType == 'episode' or item.contentType == 'season'): itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios itemlist.extend(itemlist_alt) return itemlist @@ -913,14 +923,14 @@ def episodios(item): #logger.debug(item) - curr_page = 1 # Página inicial - last_page = 99999 # Última página inicial + curr_page = 1 # Página inicial + last_page = 99999 # Última página inicial if item.curr_page: - curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos - del item.curr_page # ... y lo borramos + curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos + del item.curr_page # ... y lo borramos if item.last_page: - last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos - del item.last_page # ... y lo borramos + last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos + del item.last_page # ... y lo borramos url_item = item.url.replace('1-.fx', '%s-.fx').replace('-1.fx', '-%s.fx') if item.from_title: item.title = item.from_title @@ -928,8 +938,8 @@ def episodios(item): #Limpiamos num. Temporada y Episodio que ha podido quedar por Novedades season_display = 0 if item.contentSeason: - if item.season_colapse: #Si viene del menú de Temporadas... - season_display = item.contentSeason #... salvamos el num de sesión a pintar + if item.season_colapse: #Si viene del menú de Temporadas... + season_display = item.contentSeason #... salvamos el num de sesión a pintar item.from_num_season_colapse = season_display del item.season_colapse item.contentType = "tvshow" @@ -949,14 +959,14 @@ def episodios(item): tmdb.set_infoLabels(item, True) modo_ultima_temp_alt = modo_ultima_temp - if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo + if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo modo_ultima_temp_alt = False max_temp = 1 if item.infoLabels['number_of_seasons']: max_temp = item.infoLabels['number_of_seasons'] y = [] - if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca patron = 'season (\d+)' matches = re.compile(patron, re.DOTALL).findall(str(item.library_playcounts)) for x in matches: @@ -967,19 +977,19 @@ def episodios(item): # Descarga la página data = '' - url = url_item % curr_page #Inserto en num de página en la url + url = url_item % curr_page #Inserto en num de página en la url try: data = re.sub(r"\n|\r|\t|\s{2}|()| ", "", httptools.downloadpage(url, timeout=timeout).data) data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - except: #Algún error de proceso, salimos + except: #Algún error de proceso, salimos pass if not data: logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist + break #Pintamos lo que tenemos - curr_page += 1 #Apunto ya a la página siguiente + curr_page += 1 #Apunto ya a la página siguiente #Usamos el mismo patrón que en listado patron = '
    ' @@ -996,7 +1006,7 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -1080,10 +1090,10 @@ def episodios(item): else: item_local.title = '%sx%s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) - if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: - curr_page = 999999 #Sale del bucle de leer páginas - break #Sale del bucle actual del WHILE de episodios por página + curr_page = 999999 #Sale del bucle de leer páginas + break #Sale del bucle actual del WHILE de episodios por página if season_display > 0: if item_local.contentSeason > season_display: @@ -1098,10 +1108,10 @@ def episodios(item): if len(itemlist) > 1: itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas + if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas item, itemlist = generictools.post_tmdb_seasons(item, itemlist) - if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo + if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo # Pasada por TMDB y clasificación de lista por temporada y episodio tmdb.set_infoLabels(itemlist, True) diff --git a/plugin.video.alfa/channels/grantorrent.json b/plugin.video.alfa/channels/grantorrent.json index d82d7313..e3f8591e 100644 --- a/plugin.video.alfa/channels/grantorrent.json +++ b/plugin.video.alfa/channels/grantorrent.json @@ -3,14 +3,15 @@ "name": "GranTorrent", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "grantorrent.jpg", "banner": "grantorrent.png", "fanart": "grantorrent.png", "categories": [ "torrent", "movie", - "tvshow" + "tvshow", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index e79df7bf..1e25ceef 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -72,39 +72,39 @@ def submenu(item): if not data: logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #Algo no funciona, pintamos lo que tenemos + return itemlist #Algo no funciona, pintamos lo que tenemos if item.extra == "peliculas": patron = '
  • ') #Seleccionamos la zona de links patron = '\/icono_.*?png" title="(?P.*?)?" [^>]+><\/td>(?P.*?)?.*?(?P.*?)?<\/td>= item.infoLabels["number_of_seasons"]: #Si tenemos en .nfo igaual o más temporadas, investigar cnt_s = 0 - for s in item.library_playcounts: #Ver cuántas Temporadas hay en Videoteca + for s in item.library_playcounts: #Ver cuántas Temporadas hay en Videoteca if "season" in s: cnt_s += 1 - if cnt_s > 1: #hay más de 1 temporada en Videoteca, es Serie? - if temp_actual_num > 1: #Temp. actual > 1, parece Temporada + if cnt_s > 1: #hay más de 1 temporada en Videoteca, es Serie? + if temp_actual_num > 1: #Temp. actual > 1, parece Temporada s = 1 while s <= item.infoLabels["number_of_seasons"]: #Buscamos la primera Temporada de Videoteca if item.library_playcounts.has_key('season %d' % s): #Buscamos si la Temporada 1 existe @@ -564,19 +578,19 @@ def episodios(item): item.contentType = "tvshow" #No es Temporada 1, pero es más baja que la actual. Es Serie break s += 1 - else: #Sí, es Serie + else: #Sí, es Serie item.contentType = "tvshow" - else: #Solo hay una temporada en la Videoteca - if temp_actual_num > 1: #es Temporada la actual? + else: #Solo hay una temporada en la Videoteca + if temp_actual_num > 1: #es Temporada la actual? if item.contentSeason: - item.contentType = "season" #Si está informado el num de Temp. se creó como Temporada + item.contentType = "season" #Si está informado el num de Temp. se creó como Temporada else: - item.contentType = "tvshow" #Si no, es Serie que no tiene Temp. 1 - else: #Si es Temp. 1, se procesa según el valor de configuración - if modo_serie_temp == 0: #Es Temporada + item.contentType = "tvshow" #Si no, es Serie que no tiene Temp. 1 + else: #Si es Temp. 1, se procesa según el valor de configuración + if modo_serie_temp == 0: #Es Temporada item.contentType = "season" - else: #Es Serie + else: #Es Serie item.contentType = "tvshow" else: item.contentType = "list" @@ -592,21 +606,21 @@ def episodios(item): #Controla que no haya un bucle en la cadena de links entre temporadas if scrapertools.find_single_match(temp_actual, patron_actual_num) in temp_lista: temp_bucle += 1 - if temp_bucle > 5: #Si ha pasado por aquí más de 5 veces es que algo anda mal + if temp_bucle > 5: #Si ha pasado por aquí más de 5 veces es que algo anda mal logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) data = '' - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos if temp_advance == "back": #Se salta una temporada hacia atrás logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link BACK erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data) temp_actual = scrapertools.find_single_match(data, patron_previous) #url de temporada anterior data = '' - continue #volvemos a leer página con la url de la anterior + continue #volvemos a leer página con la url de la anterior if temp_advance == "forw": #Se salta una temporada hacia adelante logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link FORW erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data) temp_actual = scrapertools.find_single_match(data, patron_next) #url de temporada siguiente data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente #Comprobamos si se ha saltado una Temporada if temp_advance == "back": #Avanza marcha atrás? @@ -625,9 +639,9 @@ def episodios(item): logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) data = '' itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente #Comprobamos si se ha saltado una Temporada if temp_advance == "forw": #Avanza marcha adelante? @@ -646,9 +660,9 @@ def episodios(item): logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) data = '' itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente temp_actual_num = scrapertools.find_single_match(temp_actual, patron_actual_num) #num de la temporada actual temp_actual_num = int(temp_actual_num) @@ -660,7 +674,7 @@ def episodios(item): except: #Error al leer o procesar la página actual? Salimos logger.error("ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos if item.contentType == "season": temp_advance = '' #Es la única temporada @@ -700,7 +714,7 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -752,7 +766,7 @@ def episodios(item): item_local.contentSeason = temp_actual_num item_local.contentSeason = int(item_local.contentSeason) item_local.contentEpisodeNumber = 1 - else: #si es un episodio lo guardamos + else: #si es un episodio lo guardamos if scrapertools.find_single_match(temp_epi, r'(\d+)&#.*?;(\d+)'): item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(temp_epi, r'(\d+)&#.*?;(\d+)') if not item_local.contentSeason: @@ -766,32 +780,32 @@ def episodios(item): item_local.contentEpisodeNumber = int(item_local.contentEpisodeNumber) except: logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + temp_epi) - continue #si da un error pasamos del episodio + continue #si da un error pasamos del episodio if item_local.contentSeason != temp_actual_num: #A veces es diferente el num de Temp. de la URL y de temp_actual_num = item_local.contentSeason #los episodios. Anatomia de Grey Temp. 14 - if "-" in temp_epi: #episodios múltiples + if "-" in temp_epi: #episodios múltiples episode2 = scrapertools.find_single_match(temp_epi, r'-(\d+)') - item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango de episodios + item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango de episodios elif "temporada" in temp_epi.lower() or "completa" in temp_epi.lower(): #Temporada completa episode2 = 99 - item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango ficticio de episodios - elif item_local.contentEpisodeNumber == 0: #episodio extraño + item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango ficticio de episodios + elif item_local.contentEpisodeNumber == 0: #episodio extraño item_local.title = '%sx%s - %s' % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), temp_epi) - else: #episodio normal + else: #episodio normal item_local.title = '%sx%s -' % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2)) - if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and item_local.title == itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... + if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and item_local.title == itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... if itemlist[-1].quality: - itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades + itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades else: itemlist[-1].quality = quality - continue #ignoramos el episodio duplicado + continue #ignoramos el episodio duplicado else: item_local.quality = quality - itemlist.append(item_local.clone()) #guardamos el episodio + itemlist.append(item_local.clone()) #guardamos el episodio #logger.debug("EPISODIOS: " + temp_actual + " (" + str (item_local.contentSeason) + "x" + str (item_local.contentEpisodeNumber) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista Temps: " + str(temp_lista)) #logger.debug(item_local) @@ -823,7 +837,7 @@ def episodios(item): def actualizar_titulos(item): logger.info() - item = generictools.update_title(item) #Llamamos al método que actualiza el título con tmdb.find_and_set_infoLabels + item = generictools.update_title(item) #Llamamos al método que actualiza el título con tmdb.find_and_set_infoLabels #Volvemos a la siguiente acción en el canal return item @@ -835,7 +849,7 @@ def search(item, texto): itemlist = [] item.url = "%s?s=%s" % (item.url, texto) - item.media = "search" #Marcar para "Listado": igual comportamiento que "Categorías" + item.media = "search" #Marcar para "Listado": igual comportamiento que "Categorías" try: if "series/" in item.url: diff --git a/plugin.video.alfa/channels/mejortorrent1.json b/plugin.video.alfa/channels/mejortorrent1.json index dd27bb1a..a06a4b5f 100644 --- a/plugin.video.alfa/channels/mejortorrent1.json +++ b/plugin.video.alfa/channels/mejortorrent1.json @@ -3,14 +3,15 @@ "name": "Mejor Torrent 1", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "mejortorrent.png", "banner": "mejortorrent.png", "categories": [ "torrent", "movie", "tvshow", - "documentary" + "documentary", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/mejortorrent1.py b/plugin.video.alfa/channels/mejortorrent1.py index f2cf315f..cc9966c0 100644 --- a/plugin.video.alfa/channels/mejortorrent1.py +++ b/plugin.video.alfa/channels/mejortorrent1.py @@ -117,13 +117,12 @@ def alfabeto(item): def listado(item): logger.info() itemlist = [] - url_next_page ='' # Control de paginación - cnt_tot = 30 # Poner el num. máximo de items por página + url_next_page ='' # Control de paginación + cnt_tot = 30 # Poner el num. máximo de items por página - if item.category: - del item.category if item.totalItems: del item.totalItems + item.category = item.channel.capitalize() try: data = '' @@ -134,27 +133,27 @@ def listado(item): logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - if not data: #Si la web está caída salimos sin dar error + if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos # En este canal las url's y los títulos tienen diferente formato dependiendo del contenido - if (item.extra == "peliculas" or item.extra == "varios") and item.tipo: #Desde Lista Alfabética + if (item.extra == "peliculas" or item.extra == "varios") and item.tipo: #Desde Lista Alfabética patron = '([^<]+)?<\/a>' patron_enlace = '\/\/.*?\/(.*?)\/$' patron_title = '([^<]+)<\/a>(\s*([^>]+)<\/b>)?' item.action = "findvideos" item.contentType = "movie" - pag = False #No hay paginación + pag = False #No hay paginación elif (item.extra == "peliculas" or item.extra == "varios") and not item.tipo: #Desde Menú principal patron = '?' patron_enlace = '\/\/.*?\/(.*?)\/$' patron_title = '([^<]+)<\/a>(\s*([^>]+)<\/b>)?' item.action = "findvideos" item.contentType = "movie" - pag = True #Sí hay paginación - cnt_tot = 20 # Poner el num. máximo de items por página. Parece que hay 18 + pag = True #Sí hay paginación + cnt_tot = 20 # Poner el num. máximo de items por página. Parece que hay 18 item.next_page = 'b' elif item.extra == "series" and item.tipo: patron = '([^<]+)?<\/a>' @@ -165,7 +164,7 @@ def listado(item): item.action = "episodios" item.contentType = "season" pag = False - cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado + cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado elif item.extra == "series" and not item.tipo: patron = '?' patron_enlace = '\/\/.*?\/(.*?)-[temporada]?\d+[-|x]' @@ -175,7 +174,7 @@ def listado(item): item.action = "episodios" item.contentType = "season" pag = True - cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado + cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado elif item.extra == "documentales" and item.tipo: patron = '([^<]+)?<\/a>' patron_enlace = '\/\/.*?\/(.*?)-[temporada]?\d+[-|x]' @@ -219,13 +218,13 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Capturamos el num. de la última página para informala a pié de página. Opción para páginas sin paginación if pag == False: item.last_page = (len(matches) / cnt_tot) + 1 - if not item.last_page and pag: #Capturamos el num. de la última página para informala a pié de página + if not item.last_page and pag: #Capturamos el num. de la última página para informala a pié de página item.last_page = -1 #patron_next_page = " Siguiente >> <\/a>" if "/documentales" in item.url: @@ -309,7 +308,7 @@ def listado(item): item_local.thumbnail = scrapedthumbnail if "http" not in item_local.thumbnail: item_local.thumbnail = '' - item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente + item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente # Para que el menú contextual muestre conrrectamente las opciones de añadir a Videoteca if item_local.extra == "series": @@ -327,15 +326,18 @@ def listado(item): data_epi = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item_local.url).data) url = scrapertools.find_single_match(data_epi, '.*

    .*?)<\/form>"): + url = item_local.url #Salvamos la url original + if not url: #No encuentro la Temporada. Lo dejo como capítulo suelto item_local.action = "findvideos" item_local.contentEpisodeNumber = episodio if not item_local.contentEpisodeNumber: item_local.contentEpisodeNumber = 1 logger.debug(item_local) logger.debug(data_epi) - else: #Busco la temporada. Salvo url de episodio por si acaso + else: #Busco la temporada. Salvo url de episodio por si acaso #item_local.url_ori = item_local.url item_local.url = url item_local.contentType = "season" @@ -386,7 +388,7 @@ def listado(item): # Limpiamos títulos, Sacamos datos de calidad, audio y lenguaje scrapedtitle = re.sub('\r\n', '', scrapedtitle_alt).decode('utf8').encode('utf8').strip() title = scrapedtitle - title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ") + title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ").replace("×", "x") title_subs = [] @@ -400,10 +402,7 @@ def listado(item): title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") - if "3d" in title.lower(): #Reservamos info para después de TMDB - item_local.quality += " 3D" - title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "") - if "audio" in title.lower(): #Reservamos info de audio para después de TMDB + if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) if "[dual" in title.lower(): @@ -427,7 +426,7 @@ def listado(item): # scrapedinfo tiene la calidad, pero solo en llamadas desde peliculas sin alfabeto if item_local.extra == "series" or item_local.extra == "documentales": if item_local.quality: - title = re.sub(r'[\[|\(]\d+.*?[\)|\]]', '', title) # Quitar la calidad del título + title = re.sub(r'[\[|\(]\d+.*?[\)|\]]', '', title) # Quitar la calidad del título info = "" if not item_local.contentSerieName: item_local.contentSerieName = title.strip() @@ -435,12 +434,20 @@ def listado(item): item_local.contentSerieName = "SIN TITULO" if item_local.infoLabels['title']: del item_local.infoLabels['title'] + if item_local.contentType == "episode": + title = re.sub(r'\d+x\d+(?: al \d+)?', '', title) if info != "" and not item_local.quality: item_local.quality = info + if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality: + if item_local.quality: + item_local.quality += ' ' + item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') + if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality: + item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') + title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title) + title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if not item_local.quality: if "fullbluray" in title.lower(): @@ -450,12 +457,13 @@ def listado(item): item_local.quality = "4K" title = title.replace("4k-hdr", "").replace("4K-HDR", "").replace("hdr", "").replace("HDR", "").replace("4k", "").replace("4K", "") title = title.replace("(", "").replace(")", "").replace("[", "").replace("]", "").strip() - if item_local.extra == "peliculas": + if item_local.contentType == "movie": item_local.title = title item_local.contentTitle = title elif item_local.contentType != "episode": item_local.title = title item_local.title = item_local.contentSerieName + title = item_local.contentSerieName item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título if "saga" in item_local.contentTitle.lower() or "saga" in item_local.contentSerieName.lower(): @@ -505,14 +513,14 @@ def listado(item): def listado_busqueda(item): logger.info() itemlist = [] - url_next_page ='' # Controlde paginación - cnt_tot = 39 # Poner el num. máximo de items por página. Dejamos que la web lo controle - cnt_title = 0 # Contador de líneas insertadas en Itemlist - cnt_pag = 0 # Contador de líneas leídas de Matches - cnt_next = 0 # Contador de páginas leidas antes de pintar la pantalla - total_pag = 10 # Líneas por página de la web - curr_page_num = 1 # Página actual - category = "" # Guarda la categoria que viene desde una busqueda global + url_next_page ='' # Controlde paginación + cnt_tot = 39 # Poner el num. máximo de items por página. Dejamos que la web lo controle + cnt_title = 0 # Contador de líneas insertadas en Itemlist + cnt_pag = 0 # Contador de líneas leídas de Matches + cnt_next = 0 # Contador de páginas leidas antes de pintar la pantalla + total_pag = 10 # Líneas por página de la web + curr_page_num = 1 # Página actual + category = "" # Guarda la categoria que viene desde una busqueda global matches = [] if item.url_next_page: @@ -523,7 +531,7 @@ def listado_busqueda(item): #Máximo num. de líneas permitidas por TMDB. Máx de 5 páginas por Itemlist para no degradar el rendimiento while cnt_title <= cnt_tot and cnt_next < 5: - status = False # Calidad de los datos leídos + status = False # Calidad de los datos leídos data = '' try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url_next_page, post=item.post).data) @@ -532,10 +540,20 @@ def listado_busqueda(item): except: logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos cnt_next += 1 @@ -561,7 +579,11 @@ def listado_busqueda(item): logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log')) - item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Llamamos al método para el pintado del error + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Capturamos el num. de la última página para informala a pié de página @@ -591,7 +613,7 @@ def listado_busqueda(item): item_local = item.clone() if item_local.category: category = item.category - del item_local.category + item_local.category = item_local.channel.capitalize() item_local.tipo = True del item_local.tipo if item_local.totalItems: @@ -624,9 +646,6 @@ def listado_busqueda(item): title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") - if "3d" in title or "3D" in title: #Reservamos info para después de TMDB - item_local.quality += " 3D" - title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "") if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) @@ -645,7 +664,8 @@ def listado_busqueda(item): title = scrapertools.remove_htmltags(title) # Ahora preparamos el título y la calidad tanto para series como para documentales y películas - if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype): + #if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype): + if item.extra == "novedades": item_local.quality = scrapertools.find_single_match(scrapedtitle, '.*?\[(.*?)\]') else: item_local.quality = scrapertools.remove_htmltags(scrapedquality).decode('utf8').encode('utf8') @@ -660,8 +680,8 @@ def listado_busqueda(item): item_local.extra = "documentales" item_local.contentType = "season" - title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título - item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada \d+\s?').strip() + title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título + item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada\s?(?:\d+)?\s?').strip() if not item_local.contentSerieName: item_local.contentSerieName = title.strip() if item_local.infoLabels['title']: @@ -673,12 +693,17 @@ def listado_busqueda(item): item_local.contentSeason = scrapertools.find_single_match(scrapedurl, 'temporada-?(?:\d+p-)?(\d{1,2})[-|\/]') if not item_local.contentSeason: item_local.contentSeason = 1 + title = title.replace('Temporada', '').replace('temporada', '') + if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality: + if item_local.quality: + item_local.quality += ' ' + item_local.quality += scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') + if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality: + item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') + title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title) + title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, r'\(.*?\)?\(.*?\)') - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, r'[\[|\(](.*?)[\)|\]]') title = re.sub(r'\(.*?\)?\(.*?\)', '', title) title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if not item_local.quality: @@ -743,10 +768,12 @@ def listado_busqueda(item): def findvideos(item): logger.info() itemlist = [] + + #logger.debug(item) data = '' torrent_data = '' - headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent + headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent #Llamamos al método para crear el título general del vídeo, con toda la información obtenida de TMDB item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) @@ -781,7 +808,7 @@ def findvideos(item): #logger.debug(matches) #logger.debug(data) - for scrapedurl, name1, value1, value2, name2 in matches: + for scrapedurl, name1, value1, value2, name2 in matches: #Hacemos el FOR aunque solo habrá un item #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() url = scrapedurl @@ -790,19 +817,18 @@ def findvideos(item): post = '%s=%s&%s=%s' % (name1, value1, name2, value2) try: torrent_data = httptools.downloadpage(url, post=post, headers=headers, follow_redirects=False) - except: #error + except: #error pass else: - #Generamos una copia de Item para trabajar sobre ella + #Viene de SERIES y DOCUMENTALES. Generamos una copia de Item para trabajar sobre ella item_local = item.clone() try: #Localiza el .torrent en el siguiente link con Post. Viene de Documentales y Varios url = item.url_post torrent_data = httptools.downloadpage(url, post=item.post, headers=headers, follow_redirects=False) except: pass - - #logger.debug(torrent_data.headers) + if not torrent_data: item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -813,7 +839,8 @@ def findvideos(item): itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - item_local.url = torrent_data.headers['location'] #Capturamos la url del .torrent desde el Header + #Capturamos la url del .torrent desde el Header + item_local.url = torrent_data.headers['location'] if 'location' in torrent_data.headers else item.url_post item_local.url = item_local.url.replace(" ", "%20") #Quitamos espacios # Poner la calidad, si es necesario @@ -838,14 +865,14 @@ def findvideos(item): #Ahora pintamos el link del Torrent, si lo hay if item_local.url: # Hay Torrent ? - item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.quality, str(item_local.language)) #Preparamos título de Torrent + item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.quality, str(item_local.language)) #Preparamos título de Torrent item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos - item_local.alive = "??" #Calidad del link sin verificar - item_local.action = "play" #Visualizar vídeo - item_local.server = "torrent" #Seridor Torrent + item_local.alive = "??" #Calidad del link sin verificar + item_local.action = "play" #Visualizar vídeo + item_local.server = "torrent" #Seridor Torrent - itemlist.append(item_local.clone()) #Pintar pantalla + itemlist.append(item_local.clone()) #Pintar pantalla #logger.debug("title=[" + item.title + "], torrent=[ " + item_local.url + " ], url=[ " + url + " ], post=[" + item.post + "], thumbnail=[ " + item.thumbnail + " ]" + " size: " + size) #logger.debug(item_local) @@ -862,28 +889,38 @@ def episodios(item): tmdb.set_infoLabels(item, True) # Carga la página - data = '' + data_ini = '' try: - data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) - data = data.replace('"', "'") - except: #Algún error de proceso, salimos + data_ini = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) + data_ini = data_ini.replace('"', "'") + except: #Algún error de proceso, salimos pass - if not data: + if not data_ini: logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) return itemlist # Selecciona en tramo que nos interesa - data = scrapertools.find_single_match(data, "(
    .*?)<\/form>") + data = scrapertools.find_single_match(data_ini, "(.*?)<\/form>") # Prepara el patrón de búsqueda - if item.extra == "documentales": - patron = "" - url, value2, name2 = scrapertools.find_single_match(data, patron) - patron = "" - else: - patron = "[^<]+<\/a><\/td>]+>]+>([^<]+)?<\/div><\/td>" + patron = " Date: Wed, 5 Sep 2018 18:05:16 +0200 Subject: [PATCH 12/18] =?UTF-8?q?NewPct1:=20clon=20Planetatorrent=20a?= =?UTF-8?q?=C3=B1adido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/newpct1.json | 7 +- plugin.video.alfa/channels/newpct1.py | 384 +++++++++++++----------- plugin.video.alfa/lib/generictools.py | 305 ++++++++++--------- 3 files changed, 376 insertions(+), 320 deletions(-) diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json index 71fbcd79..7c6f0412 100644 --- a/plugin.video.alfa/channels/newpct1.json +++ b/plugin.video.alfa/channels/newpct1.json @@ -3,7 +3,7 @@ "name": "Newpct1", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "newpct1.png", "banner": "newpct1.png", "categories": [ @@ -44,6 +44,7 @@ "Tumejortorrent", "Torrentlocura", "Tvsinpagar", + "Planetatorrent", "Descargas2020", "Mispelisyseries" ] @@ -52,7 +53,7 @@ "id": "clonenewpct1_channels_list", "type": "text", "label": "Lista de clones de NewPct1 y orden de uso", - "default": "('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')", + "default": "('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'planetatorrent', 'http://planetatorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')", "enabled": true, "visible": false }, @@ -60,7 +61,7 @@ "id": "intervenidos_channels_list", "type": "text", "label": "Lista de canales y clones de NewPct1 intervenidos y orden de sustitución de URLs", - "default": "('0', 'canal_org', 'canal_des', 'url_org', 'url_des', 'patron1', 'patron2', 'patron3', 'patron4', 'patron5', 'content_inc', 'content_exc', 'ow_force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-([^.]+).html', '', '', '', 'movie', '', 'force'), ('1', 'newpct1', '', '', '', '', '', '', '', '', '*', '', 'del'), ('1', 'videolibrary', '', '', '', '', '', '', '', '', '*', '', 'del')", + "default": "('0', 'canal_org', 'canal_des', 'url_org', 'url_des', 'patron1', 'patron2', 'patron3', 'patron4', 'patron5', 'content_inc', 'content_exc', 'ow_force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-([^.]+).html', '', '', '', 'movie', '', 'force')", "enabled": true, "visible": false }, diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index 7a11e3aa..d7e9cfe9 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -64,7 +64,7 @@ episodio_serie = config.get_setting('clonenewpct1_serie_episodio_novedades', cha #Temporal, sólo para actualizar newpct1_data.json con otro valor por defecto #channel_banned = config.get_setting('clonenewpct1_excluir1_enlaces_veronline', channel_py) #1eer Canal baneado #if channel_banned == 9: -# config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto +# config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto def mainlist(item): @@ -148,7 +148,7 @@ def submenu(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -161,11 +161,11 @@ def submenu(item): if "pelisyseries.com" in item.channel_host and item.extra == "varios": #compatibilidad con mispelisy.series.com data = '
  • Documentales
  • ' else: - data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa + data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa if not data: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '
  • ([^>]+)<\/a><\/li>' matches = re.compile(patron, re.DOTALL).findall(data) @@ -173,7 +173,7 @@ def submenu(item): if not matches: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.strip() @@ -208,7 +208,7 @@ def submenu_novedades(item): if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, timeout=timeout_search).data) @@ -232,7 +232,7 @@ def submenu_novedades(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -307,7 +307,7 @@ def alfabeto(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: ALFABETO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -323,7 +323,7 @@ def alfabeto(item): if not matches: logger.error("ERROR 02: ALFABETO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: ALFABETO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.upper() @@ -336,9 +336,9 @@ def alfabeto(item): def listado(item): logger.info() itemlist = [] - clase = "pelilist" # etiqueta para localizar zona de listado de contenidos - url_next_page ='' # Control de paginación - cnt_tot = 30 # Poner el num. máximo de items por página + clase = "pelilist" # etiqueta para localizar zona de listado de contenidos + url_next_page ='' # Control de paginación + cnt_tot = 30 # Poner el num. máximo de items por página if item.totalItems: del item.totalItems @@ -363,7 +363,7 @@ def listado(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Establecemos los valores básicos en función del tipo de contenido if item.extra == "peliculas": @@ -387,7 +387,7 @@ def listado(item): if not fichas and not '

    ( 0 ) Resultados encontrados ' in data: #error logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif '

    ( 0 ) Resultados encontrados ' in data: #no hay vídeos return itemlist else: @@ -395,16 +395,16 @@ def listado(item): page_extra = clase #Scrapea los datos de cada vídeo. Título alternativo se mantiene, aunque no se usa de momento - patron = '( 0 ) Resultados encontrados ' in data): item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -709,34 +713,40 @@ def listado_busqueda(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + if len(itemlist) > 2: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento host = host.replace(item.channel_alt, item.channel) #Obtiene la dirección de la próxima página, si la hay try: - post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás - - if item.extra == "novedades": - get, post, total_pag = scrapertools.find_single_match(data, '