From b04cf69d1fef657af92696b1848fb4d91b86ba57 Mon Sep 17 00:00:00 2001 From: mrgaturus Date: Sun, 4 Nov 2018 14:14:39 -0500 Subject: [PATCH 1/8] C2 y C2ES: cambio de estructura --- plugin.video.alfa/channels/cuevana2.py | 52 ++++++++++++++++--- plugin.video.alfa/channels/cuevana2espanol.py | 35 ++++++++++--- 2 files changed, 72 insertions(+), 15 deletions(-) diff --git a/plugin.video.alfa/channels/cuevana2.py b/plugin.video.alfa/channels/cuevana2.py index 95b63fcb..8ecefd8d 100644 --- a/plugin.video.alfa/channels/cuevana2.py +++ b/plugin.video.alfa/channels/cuevana2.py @@ -22,8 +22,7 @@ def mainlist(item): autoplay.init(item.channel, list_servers, list_quality) itemlist = [] # PELICULAS - itemlist.append(Item(channel = item.channel, title = "Peliculas", folder=False, - thumbnail = get_thumb("movies", auto = True), text_bold=True)) + itemlist.append(Item(channel = item.channel, title = "--- Peliculas ---", folder=False, text_bold=True)) itemlist.append(Item(channel = item.channel, title = "Novedades", action = "movies", url = host + "pelicula", thumbnail = get_thumb("newest", auto = True))) @@ -37,8 +36,7 @@ def mainlist(item): url = host + "search/", thumbnail = get_thumb("search", auto = True))) # SERIES - itemlist.append(Item(channel = item.channel, title = "Series", folder=False, - thumbnail = get_thumb("tvshows", auto = True), text_bold=True)) + itemlist.append(Item(channel = item.channel, title = "--- Series ---", folder=False, text_bold=True)) itemlist.append(Item(channel = item.channel, title = "Todas las Series", action = "shows", url = host + "listar-series", thumbnail = get_thumb("tvshows", auto = True))) @@ -63,6 +61,11 @@ def load_data(url): return data +def redirect_url(url, parameters=None): + data = httptools.downloadpage(url, post=parameters) + logger.info(data.url) + return data.url + def put_movies(itemlist, item, data, pattern): matches = scrapertools.find_multiple_matches(data, pattern) for link, img, title, rating, plot in matches: @@ -201,7 +204,25 @@ def age(item): def GKPluginLink(hash): hashdata = urllib.urlencode({r'link':hash}) json = httptools.downloadpage('https://player4.cuevana2.com/plugins/gkpluginsphp.php', post=hashdata).data - return jsontools.load(json)['link'] if json else '' + logger.info(jsontools.load(json)) + + data = jsontools.load(json) if json else False + if data: + return data['link'] if 'link' in data else None + else: + return None + +def RedirectLink(hash): + hashdata = urllib.urlencode({r'url':hash}) + return redirect_url('https://player4.cuevana2.com/r.php', hashdata) + +def OpenloadLink(hash): + hashdata = urllib.urlencode({r'h':hash}) + json = httptools.downloadpage('https://api.cuevana2.com/openload/api.php', post=hashdata).data + logger.info("CUEVANA OL JSON %s" % json) + data = jsontools.load(json) if json else False + + return data['url'] if data['status'] == 1 else None #el pattern esta raro para eliminar los duplicados, de todas formas asi es un lenguaje de programacion verificando su sintaxis def getContentMovie(data, item): @@ -235,29 +256,41 @@ def findvideos(item): pattern = '';return embedCode;}document.getElementById('share_embed').value = getEmbed();var adList = [];if(fluidPlayerClass.getCookie('pb_vast')==1) {adList.push({roll: 'preRoll',vastTag: "https://syndication.exosrv.com/splash.php?idzone=3180702",});} else {adList.push({roll: 'preRoll',vastTag: "https://syndication.exosrv.com/splash.php?idzone=2946968",});}adList.push({roll: 'midRoll',vastTag: 'https://syndication.exosrv.com/splash.php?idzone=2947082',size : '728x90',cookieTime : 1,timer:10,});htmlOnPauseBlock = {html : '
Advertisement
',height: 277,width:304,onBeforeShow : function() {}};var myFP = fluidPlayer('main_video',{layoutControls: {timelinePreview: {file: 'https://fapality.com/thumbnails.vtt?id=23869&i=5&d=420&format=inplayer',type: 'VTT'},allowTheatre: true,allowDownload: allow_download,primaryColor:'#fb5350',shareCs:{url : 'https://fapality.com/cs/nubiles-porn/',title : 'View full video at Nubiles-Porn',},playbackRateEnabled: true,htmlOnPauseBlock: htmlOnPauseBlock,controlBar: {autoHide: true,autoHideTimeout: 3,animated: true,},},vastOptions: {adList: adList,vastAdvanced: {vastLoadedCallback: (function() {if(fluidPlayerClass.getCookie('pb_source')=="1") {fluidPlayerClass.setCookie('pb_vast',1,6);}}),noVastVideoCallback: (function() {}),vastVideoSkippedCallback: (function() {}),vastVideoEndedCallback: (function() {})},adCTAText: false,vastTimeout: 5000,}});var player_obj = myFP;
Nubiles-Porn
0
+ + + patron = '", "", data) + patron = '.*?([^"]+)' + matches = re.compile(patron,re.DOTALL).findall(data) + scrapertools.printMatches(matches) + for scrapedurl,scrapedtitle,scrapedthumbnail,cantidad in matches: + scrapedplot = "" + scrapedtitle = scrapedtitle + " (" + cantidad + ")" + itemlist.append( Item(channel=item.channel, action="peliculas", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) ) + return itemlist + + +def peliculas(item): + logger.info() + itemlist = [] + data = scrapertools.cachePage(item.url) + data = re.sub(r"\n|\r|\t| |
", "", data) + patron = '
  • ' + matches = re.compile(patron,re.DOTALL).findall(data) + for scrapedthumbnail,scrapedurl,scrapedtitle in matches: + contentTitle = scrapedtitle + title = scrapedtitle + thumbnail = scrapedthumbnail + plot = "" + year = "" + itemlist.append( Item(channel=item.channel, action="findvideos" , title=title , url=scrapedurl, thumbnail=thumbnail, plot=plot, contentTitle=contentTitle, infoLabels={'year':year} )) + next_page_url = scrapertools.find_single_match(data,'([^<]+)' + matches = re.compile(patron,re.DOTALL).findall(data) + scrapertools.printMatches(matches) + for scrapedurl,scrapedtitle in matches: + scrapedplot = "" + scrapedthumbnail = "" + itemlist.append( Item(channel=item.channel, action="peliculas", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) ) + return itemlist + + +def peliculas(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '

    .*?' + patron += '.*?' + patron += 'src="([^"]+)"' + matches = re.compile(patron,re.DOTALL).findall(data) + scrapertools.printMatches(matches) + for scrapedurl,scrapedtitle,scrapedthumbnail in matches: + plot = "" + itemlist.append( Item(channel=item.channel, action="findvideos", title=scrapedtitle , fulltitle=scrapedtitle, url=scrapedurl , thumbnail=scrapedthumbnail , plot=plot , viewmode="movie", folder=True) ) + next_page_url = scrapertools.find_single_match(data,'Next') + if next_page_url!="": + next_page_url = urlparse.urljoin(item.url,next_page_url) + itemlist.append( Item(channel=item.channel , action="peliculas" , title="Página Siguiente >>" , text_color="blue", url=next_page_url , folder=True) ) + return itemlist + diff --git a/plugin.video.alfa/channels/foxtube.json b/plugin.video.alfa/channels/foxtube.json new file mode 100644 index 00000000..ebd92c88 --- /dev/null +++ b/plugin.video.alfa/channels/foxtube.json @@ -0,0 +1,16 @@ +{ + "id": "foxtube", + "name": "foxtube", + "active": true, + "adult": true, + "language": ["*"], + "thumbnail": "http://fxtimg.com/xlogo_.png.pagespeed.ic.doVRQMV5ub.png", + "banner": "", + "categories": [ + "adult" + ], + "settings": [ + + ] +} + diff --git a/plugin.video.alfa/channels/foxtube.py b/plugin.video.alfa/channels/foxtube.py new file mode 100644 index 00000000..d7c66c2c --- /dev/null +++ b/plugin.video.alfa/channels/foxtube.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +#------------------------------------------------------------ +import urlparse,urllib2,urllib,re +import os, sys +from platformcode import config, logger +from core import scrapertools +from core.item import Item +from core import servertools +from core import httptools +from core import tmdb +from core import jsontools + +host = 'http://es.foxtube.com' + +def mainlist(item): + logger.info() + itemlist = [] + itemlist.append( Item(channel=item.channel, title="Peliculas" , action="peliculas", url=host)) + itemlist.append( Item(channel=item.channel, title="Categorias" , action="categorias", url=host)) + itemlist.append( Item(channel=item.channel, title="Buscar", action="search")) + return itemlist + + +def search(item, texto): + logger.info() + texto = texto.replace(" ", "+") + item.url = host + "/buscador/%s" % texto + try: + return peliculas(item) + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + + +def categorias(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
  • ([^"]+)' + matches = re.compile(patron,re.DOTALL).findall(data) + scrapertools.printMatches(matches) + for scrapedurl,scrapedtitle in matches: + scrapedplot = "" + scrapedthumbnail = "" + scrapedurl = host + scrapedurl + itemlist.append( Item(channel=item.channel, action="peliculas", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) ) + return itemlist + + +def peliculas(item): + logger.info() + itemlist = [] + data = scrapertools.cachePage(item.url) + patron = '.*?src="([^"]+)".*?alt="([^"]+)">.*?(.*?)' + matches = re.compile(patron,re.DOTALL).findall(data) + for scrapedurl,scrapedthumbnail,scrapedtitle,duracion in matches: + url = host + scrapedurl + title = "[COLOR yellow]" + duracion + "[/COLOR] " + scrapedtitle + contentTitle = title + thumbnail = scrapedthumbnail + plot = "" + year = "" + itemlist.append( Item(channel=item.channel, action="play" , title=title , url=url, thumbnail=thumbnail, plot=plot, contentTitle = contentTitle, infoLabels={'year':year} )) + next_page_url = scrapertools.find_single_match(data,'') + if next_page_url!="": + next_page_url = urlparse.urljoin(item.url,next_page_url) + itemlist.append( Item(channel=item.channel , action="peliculas" , title="Página Siguiente >>" , text_color="blue", url=next_page_url , folder=True) ) + return itemlist + + +def play(item): + logger.info() + itemlist = [] + url = scrapertools.find_single_match(scrapertools.cachePage(item.url),'