diff --git a/plugin.video.alfa/channels/datoporn.py b/plugin.video.alfa/channels/datoporn.py index ca62c977..73e0214c 100755 --- a/plugin.video.alfa/channels/datoporn.py +++ b/plugin.video.alfa/channels/datoporn.py @@ -32,7 +32,7 @@ def lista(item): matches = scrapertools.find_multiple_matches(data, patron) for scrapedurl, scrapedthumbnail, duration, scrapedtitle in matches: if "/embed-" not in scrapedurl: - scrapedurl = scrapedurl.replace("datoporn.com/", "datoporn.com/embed-") + ".html" + scrapedurl = scrapedurl.replace("dato.porn/", "dato.porn/embed-") + ".html" if duration: scrapedtitle = "%s - %s" % (duration, scrapedtitle) diff --git a/plugin.video.alfa/channels/playpornx.py b/plugin.video.alfa/channels/playpornx.py index a324d04e..c79e35fb 100644 --- a/plugin.video.alfa/channels/playpornx.py +++ b/plugin.video.alfa/channels/playpornx.py @@ -16,6 +16,7 @@ def mainlist(item): thumbnail='https://s18.postimg.org/fwvaeo6qh/todas.png', fanart='https://s18.postimg.org/fwvaeo6qh/todas.png', url ='https://www.playpornx.net/category/porn-movies/?filter=date')) + itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url='http://www.playpornx.net/?s=', thumbnail='https://s30.postimg.org/pei7txpa9/buscar.png', fanart='https://s30.postimg.org/pei7txpa9/buscar.png')) @@ -30,7 +31,6 @@ def lista(item): if item.url == '': item.url = host data = httptools.downloadpage(item.url).data data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) - logger.debug(data) patron = 'role=article>.*?src=(.*?) class' matches = re.compile(patron, re.DOTALL).findall(data) @@ -45,7 +45,7 @@ def lista(item): if itemlist != []: actual_page_url = item.url - next_page = scrapertools.find_single_match(data, 'rel="next" href="([^"]+)"') + next_page = scrapertools.find_single_match(data, '') if next_page != '': itemlist.append(Item(channel=item.channel, action="lista", title='Siguiente >>>', url=next_page, thumbnail='https://s16.postimg.org/9okdu7hhx/siguiente.png', extra=item.extra)) diff --git a/plugin.video.alfa/channels/setting.py b/plugin.video.alfa/channels/setting.py index 2b9b7110..db074015 100644 --- a/plugin.video.alfa/channels/setting.py +++ b/plugin.video.alfa/channels/setting.py @@ -866,10 +866,11 @@ def overwrite_tools(item): from core import videolibrarytools seleccion = platformtools.dialog_yesno("Sobrescribir toda la videoteca", - "Esto puede llevar algun tiempo.", + "Esto puede llevar algún tiempo.", "¿Desea continuar?") if seleccion == 1: - heading = 'Sobrescribiendo videoteca....' + # tvshows + heading = 'Sobrescribiendo videoteca....SERIES' p_dialog = platformtools.dialog_progress_bg('alfa', heading) p_dialog.update(0, '') @@ -893,5 +894,42 @@ def overwrite_tools(item): # ... y la volvemos a añadir videolibrary_service.update(path, p_dialog, i, t, serie, 3) - p_dialog.close() + + # movies + heading = 'Sobrescribiendo videoteca....PELICULAS' + p_dialog2 = platformtools.dialog_progress_bg('alfa', heading) + p_dialog2.update(0, '') + + movies_list = [] + for path, folders, files in filetools.walk(videolibrarytools.MOVIES_PATH): + movies_list.extend([filetools.join(path, f) for f in files if f.endswith(".json")]) + + logger.debug("movies_list %s" % movies_list) + + if movies_list: + t = float(100) / len(movies_list) + + for i, movie_json in enumerate(movies_list): + try: + from core import jsontools + path = filetools.dirname(movie_json) + movie = Item().fromjson(filetools.read(movie_json)) + + # Eliminamos la carpeta con la pelicula ... + filetools.rmdirtree(path) + + import math + heading = 'Actualizando videoteca....' + + p_dialog2.update(int(math.ceil((i + 1) * t)), heading, "%s: %s" % (movie.contentTitle, + movie.channel.capitalize())) + # ... y la volvemos a añadir + videolibrarytools.save_movie(movie) + except Exception, ex: + logger.error("Error al crear de nuevo la película") + template = "An exception of type %s occured. Arguments:\n%r" + message = template % (type(ex).__name__, ex.args) + logger.error(message) + + p_dialog2.close() diff --git a/plugin.video.alfa/channels/verpelis.py b/plugin.video.alfa/channels/verpelis.py index 25810528..ffa9784b 100644 --- a/plugin.video.alfa/channels/verpelis.py +++ b/plugin.video.alfa/channels/verpelis.py @@ -16,8 +16,8 @@ host = "http://ver-pelis.me" def mainlist(item): logger.info() itemlist = [] - i = 0 global i + i = 0 itemlist.append( item.clone(title = "[COLOR oldlace]Películas[/COLOR]", action = "scraper", url = host + "/ver/", thumbnail = "http://imgur.com/36xALWc.png", fanart = "http://imgur.com/53dhEU4.jpg", @@ -49,7 +49,6 @@ def categoria_anno(item): itemlist = [] data = httptools.downloadpage(item.url).data bloque = scrapertools.find_single_match(data, 'mobile_menu.*?(%s.*?)' %item.extra) - logger.info("Intel44 %s" %bloque) patron = '(?is)([^"]+)') + patron = '([^"]+)' + patron = scrapertools.find_multiple_matches(data, patron) if len(patron) > 20: if item.next_page != 20: url_next_page = item.url @@ -91,9 +90,7 @@ def scraper(item): else: patron = patron[item.i:][:20] next_page = 20 - url_next_page = item.url - for url, thumb, title, cuality in patron: title = re.sub(r"Imagen", "", title) titulo = "[COLOR floralwhite]" + title + "[/COLOR]" + " " + "[COLOR crimson][B]" + cuality + "[/B][/COLOR]" @@ -101,31 +98,13 @@ def scraper(item): if item.extra != "search": item.i += 1 - new_item = item.clone(action="findvideos", title=titulo, url=url, thumbnail=thumb, fulltitle=title, - contentTitle=title, contentType="movie", library=True) - new_item.infoLabels['year'] = get_year(url) - itemlist.append(new_item) + itemlist.append(item.clone(action="findvideos", title=titulo, url=url, thumbnail=thumb, fulltitle=title, + contentTitle=title, contentType="movie", library=True)) ## Paginación if url_next_page: itemlist.append(item.clone(title="[COLOR crimson]Siguiente >>[/COLOR]", url=url_next_page, next_page=next_page, thumbnail="http://imgur.com/w3OMy2f.png", i=item.i)) - try: - from core import tmdb - tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - for item in itemlist: - if not "Siguiente >>" in item.title: - if "0." in str(item.infoLabels['rating']): - item.infoLabels['rating'] = "[COLOR indianred]Sin puntuacíon[/COLOR]" - else: - item.infoLabels['rating'] = "[COLOR orange]" + str(item.infoLabels['rating']) + "[/COLOR]" - item.title = item.title + " " + str(item.infoLabels['rating']) - except: - pass - - for item_tmdb in itemlist: - logger.info(str(item_tmdb.infoLabels['tmdb_id'])) - return itemlist @@ -137,10 +116,12 @@ def findvideos(item): if data_post: post = 'id=' + data_post[0] + '&slug=' + data_post[1] data_info = httptools.downloadpage(host + '/ajax/cargar_video.php', post=post).data - enlaces = scrapertools.find_multiple_matches(data_info, - " (\w+ \w+).*?([^']+)") + patron = """ ([^<]+)""" + patron += """.*?([^']+)""" + enlaces = scrapertools.find_multiple_matches(data_info, patron) for server, id_enlace, name, number, idioma_calidad in enlaces: - + server = server.strip() if "SUBTITULOS" in idioma_calidad and not "P" in idioma_calidad: idioma_calidad = idioma_calidad.replace("SUBTITULOS", "VO") idioma_calidad = idioma_calidad.replace("VO", "[COLOR orangered] VO[/COLOR]") @@ -164,14 +145,23 @@ def findvideos(item): url = host + "/ajax/video.php?id=" + id_enlace + "&slug=" + name + "&quality=" + number if not "Ultra" in server: - server = "[COLOR cyan][B]" + server + "[/B][/COLOR]" + server = "[COLOR cyan][B]" + server + " [/B][/COLOR]" extra = "" else: - server = "[COLOR yellow][B]" + server + "[/B][/COLOR]" + server = "[COLOR yellow][B]Gvideo [/B][/COLOR]" extra = "yes" title = server.strip() + " " + idioma_calidad - itemlist.append(Item(channel=item.channel, action="play", title=title, url=url, fanart=item.fanart, - thumbnail=item.thumbnail, fulltitle=item.title, extra=extra, folder=True)) + itemlist.append(Item( + channel = item.channel, + action = "play", + title = title, + url = url, + fanart = item.fanart, + thumbnail = item.thumbnail, + fulltitle = item.fulltitle, + extra = extra, + folder = True + )) if item.library and config.get_videolibrary_support() and len(itemlist) > 0: infoLabels = {'tmdb_id': item.infoLabels['tmdb_id'], 'title': item.infoLabels['title']} @@ -198,16 +188,13 @@ def play(item): url = scrapertools.find_single_match(data, '(?is)iframe src="([^"]+)"') videolist = servertools.find_video_items(data=url) for video in videolist: - itemlist.append(Item(channel=item.channel, url=video.url, server=video.server, - title="[COLOR floralwhite][B]" + video.server + "[/B][/COLOR]", action="play", - folder=False)) + itemlist.append(Item( + channel = item.channel, + url = video.url, + server = video.server, + fulltitle = item.fulltitle, + thumbnail = item.thumbnail, + action = "play" + )) return itemlist - - -def get_year(url): - data = httptools.downloadpage(url).data - year = scrapertools.find_single_match(data, '

Año:(.*?)

') - if year == "": - year = " " - return year diff --git a/plugin.video.alfa/resources/media/general/default/thumb_channels_direct.png b/plugin.video.alfa/resources/media/general/default/thumb_channels_direct.png index f038ff83..79ad6eb4 100644 Binary files a/plugin.video.alfa/resources/media/general/default/thumb_channels_direct.png and b/plugin.video.alfa/resources/media/general/default/thumb_channels_direct.png differ diff --git a/plugin.video.alfa/servers/datoporn.py b/plugin.video.alfa/servers/datoporn.py index def8c651..f2cb8a4c 100755 --- a/plugin.video.alfa/servers/datoporn.py +++ b/plugin.video.alfa/servers/datoporn.py @@ -26,7 +26,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"') if not media_urls: - match = scrapertools.find_single_match(data, "") + match = scrapertools.find_single_match(data, "p,a,c,k(.*?)") data = jsunpack.unpack(match) media_urls = scrapertools.find_multiple_matches(data, 'file\:"([^"]+\.mp4)",label:"([^"]+)"') diff --git a/plugin.video.alfa/servers/downace.json b/plugin.video.alfa/servers/downace.json index 64142fce..43b392cc 100644 --- a/plugin.video.alfa/servers/downace.json +++ b/plugin.video.alfa/servers/downace.json @@ -10,7 +10,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "downace.com/embed/(.*?)", + "pattern": "downace.com/embed/([A-z0-9]+)", "url": "https://downace.com/embed/\\1" } ] @@ -46,4 +46,4 @@ ], "thumbnail": "https://s12.postimg.org/4n9fmdy7x/logo-downace.png", "version": 1 -} \ No newline at end of file +} diff --git a/plugin.video.alfa/servers/vimeo.py b/plugin.video.alfa/servers/vimeo.py index ead9058f..903f14b5 100755 --- a/plugin.video.alfa/servers/vimeo.py +++ b/plugin.video.alfa/servers/vimeo.py @@ -17,7 +17,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= page_url = scrapertools.find_single_match(page_url, ".*?video/[0-9]+") data = httptools.downloadpage(page_url, headers = headers).data - logger.info("Intel11 %s" %data) patron = 'mime":"([^"]+)"' patron += '.*?url":"([^"]+)"' patron += '.*?quality":"([^"]+)"' diff --git a/plugin.video.alfa/videolibrary_service.py b/plugin.video.alfa/videolibrary_service.py index ede7b9aa..a76ed40e 100644 --- a/plugin.video.alfa/videolibrary_service.py +++ b/plugin.video.alfa/videolibrary_service.py @@ -87,7 +87,7 @@ def check_for_update(overwrite=True): p_dialog.update(0, '') show_list = [] - for path, folders, files in filetools.walk(library.TVSHOWS_PATH): + for path, folders, files in filetools.walk(videolibrarytools.TVSHOWS_PATH): show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"]) if show_list: