Correcciones: quitar __channel__ y remplazar requests por httptools
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import urllib
|
||||
from channelselector import get_thumb
|
||||
|
||||
from core.item import Item
|
||||
from core import httptools
|
||||
from core import jsontools
|
||||
from core import scrapertools
|
||||
from core import servertools
|
||||
from platformcode import config, logger
|
||||
from channels import autoplay
|
||||
from lib import requests
|
||||
|
||||
|
||||
|
||||
host = "http://www.cuevana2.com/"
|
||||
__channel__ = "cuevana2"
|
||||
list_quality = []
|
||||
list_servers = ['rapidvideo', 'streamango', 'directo', 'yourupload', 'openload', 'dostream']
|
||||
|
||||
@@ -72,12 +70,12 @@ def load_data(url):
|
||||
|
||||
return data
|
||||
|
||||
def put_movies(itemlist, data, pattern):
|
||||
def put_movies(itemlist, item, data, pattern):
|
||||
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||
for link, img, title, rating, plot in matches:
|
||||
if 'pelicula' in link:
|
||||
itemTitle = "%s [COLOR yellow](%s/100)[/COLOR]" % (title, rating)
|
||||
itemlist.append(Item(channel = __channel__, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
url=link, plot=plot, action="findvideos"))
|
||||
logger.info(link)
|
||||
|
||||
@@ -100,7 +98,7 @@ def episodes(item):
|
||||
|
||||
matches = scrapertools.find_multiple_matches(data, seasonsPattern)
|
||||
for season, title in matches:
|
||||
itemlist.append(Item(channel = __channel__, title="[COLOR blue]%s[/COLOR]" % title))
|
||||
itemlist.append(Item(channel = item.channel, title="[COLOR blue]%s[/COLOR]" % title))
|
||||
episodeMatches = scrapertools.find_single_match(data, episodesPattern % season)
|
||||
put_episodes(itemlist, item, episodeMatches)
|
||||
|
||||
@@ -115,7 +113,7 @@ def shows(item):
|
||||
|
||||
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||
for link, title in matches:
|
||||
itemlist.append(Item(channel = __channel__, title=title, url=host + link, action="episodes"))
|
||||
itemlist.append(Item(channel = item.channel, title=title, url=host + link, action="episodes"))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -132,11 +130,11 @@ def movies(item):
|
||||
pattern += '<span style="width:([0-9]+)%">.*?'
|
||||
pattern += '"txt">(.*?)</div>' # text
|
||||
|
||||
put_movies(itemlist, data, pattern)
|
||||
put_movies(itemlist, item, data, pattern)
|
||||
|
||||
next_page = scrapertools.find_single_match(data, '<a class="nextpostslink" rel="next" href="([^"]+)">')
|
||||
if next_page:
|
||||
itemlist.append(Item(channel = __channel__, title='Siguiente Pagina', url=next_page, action="movies"))
|
||||
itemlist.append(Item(channel = item.channel, title='Siguiente Pagina', url=next_page, action="movies"))
|
||||
|
||||
#coloca las peliculas encontradas en la lista
|
||||
return itemlist
|
||||
@@ -154,8 +152,7 @@ def searchShows(itemlist, item, texto):
|
||||
logger.info(texto)
|
||||
|
||||
if inArray(texto, keywords):
|
||||
itemlist.append(Item(channel = __channel__, title=title, url=host + link, action="episodes"))
|
||||
|
||||
itemlist.append(Item(channel = item.channel, title=title, url=host + link, action="episodes"))
|
||||
|
||||
def searchMovies(itemlist, item, texto):
|
||||
texto = texto.replace(' ', '+').lower()
|
||||
@@ -197,7 +194,7 @@ def by(item, pattern):
|
||||
|
||||
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||
for link, genre in matches:
|
||||
itemlist.append(Item(channel = __channel__, title=genre, url=link, action="movies"))
|
||||
itemlist.append(Item(channel = item.channel, title=genre, url=link, action="movies"))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -208,9 +205,9 @@ def age(item):
|
||||
return by(item, '(\d+)')
|
||||
|
||||
def GKPluginLink(hash):
|
||||
re = requests.post('https://player4.cuevana2.com/plugins/gkpluginsphp.php', dict(link=hash))
|
||||
|
||||
return re.json()['link'] if re.content else ''
|
||||
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 ''
|
||||
|
||||
#el pattern esta raro para eliminar los duplicados, de todas formas asi es un lenguaje de programacion verificando su sintaxis
|
||||
def getContentMovie(data, item):
|
||||
@@ -244,7 +241,7 @@ def findvideos(item):
|
||||
pattern = '<iframe width="650" height="450" scrolling="no" src="([^"]+)'
|
||||
subtitles = scrapertools.find_single_match(data, '<iframe width="650" height="450" scrolling="no" src=".*?sub=([^"]+)"')
|
||||
|
||||
#itemlist.append(Item(channel = __channel__, title=item.url))
|
||||
#itemlist.append(Item(channel = item.channel, title=item.url))
|
||||
for link in scrapertools.find_multiple_matches(data, pattern):
|
||||
#php.*?=(\w+)&
|
||||
#url=(.*?)&
|
||||
@@ -271,6 +268,9 @@ def findvideos(item):
|
||||
# personalizadas para Directo, se agradece, por ahora solo devuelve el primero que encuentre
|
||||
if type(link) is list:
|
||||
link = link[0]['link']
|
||||
if r'chomikuj.pl' in link:
|
||||
# En algunas personas la opcion CH les da error 401
|
||||
link += "|Referer=https://player4.cuevana2.com/plugins/gkpluginsphp.php"
|
||||
|
||||
itemlist.append(
|
||||
item.clone(
|
||||
@@ -287,4 +287,4 @@ def findvideos(item):
|
||||
action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail,
|
||||
fulltitle = item.fulltitle
|
||||
))
|
||||
return itemlist
|
||||
return itemlist
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import urllib
|
||||
from channelselector import get_thumb
|
||||
|
||||
from core.item import Item
|
||||
from core import httptools
|
||||
from core import jsontools
|
||||
from core import scrapertools
|
||||
from core import servertools
|
||||
from platformcode import config, logger
|
||||
from channels import autoplay
|
||||
from lib import requests
|
||||
|
||||
|
||||
|
||||
host = "http://cuevana2espanol.com/"
|
||||
__channel__ = "cuevana2espanol"
|
||||
list_quality = []
|
||||
list_servers = ['rapidvideo', 'streamango', 'directo', 'yourupload', 'openload', 'dostream']
|
||||
|
||||
@@ -55,12 +53,12 @@ def movies(item):
|
||||
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||
for img, title, ranking, link, age in matches:
|
||||
itemTitle = "%s [COLOR yellow](%s)[/COLOR] [COLOR blue](%s)[/COLOR]" % (title, ranking, age)
|
||||
itemlist.append(Item(channel = __channel__, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
url=link, action="findvideos"))
|
||||
|
||||
next_page = scrapertools.find_single_match(data, 'href="([^"]+)" ><span class="icon-chevron-right">')
|
||||
if next_page:
|
||||
itemlist.append(Item(channel = __channel__, title="Siguiente Pagina",
|
||||
itemlist.append(Item(channel = item.channel, title="Siguiente Pagina",
|
||||
url=next_page, action="movies"))
|
||||
|
||||
return itemlist
|
||||
@@ -79,7 +77,7 @@ def moviesIMDB(item):
|
||||
itemTitle = "%s [COLOR blue](#%s)[/COLOR] [COLOR yellow](%s)[/COLOR]" % (title, rank, rating)
|
||||
img = img.replace('-90x135', '')
|
||||
|
||||
itemlist.append(Item(channel = __channel__, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
url=link, action="findvideos"))
|
||||
|
||||
return itemlist
|
||||
@@ -97,12 +95,12 @@ def searchMovies(item):
|
||||
for link, img, title, year, plot in matches:
|
||||
itemTitle = "%s [COLOR blue](%s)[/COLOR]" % (title, year)
|
||||
|
||||
itemlist.append(Item(channel = __channel__, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||
url=link, plot=plot, action="findvideos"))
|
||||
|
||||
next_page = scrapertools.find_single_match(data, 'href="([^"]+)" ><span class="icon-chevron-right">')
|
||||
if next_page:
|
||||
itemlist.append(Item(channel = __channel__, title="Siguiente Pagina",
|
||||
itemlist.append(Item(channel = item.channel, title="Siguiente Pagina",
|
||||
url=next_page, action="searchMovies"))
|
||||
|
||||
return itemlist
|
||||
@@ -114,9 +112,9 @@ def search(item, text):
|
||||
return searchMovies(item)
|
||||
|
||||
def GKPluginLink(hash):
|
||||
re = requests.post('https://player4.cuevana2.com/plugins/gkpluginsphp.php', dict(link=hash))
|
||||
|
||||
return re.json()['link'] if re.content else ''
|
||||
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 ''
|
||||
|
||||
def getContent(item, data):
|
||||
item.infoLabels["year"] = scrapertools.find_single_match(data, 'class="date">.*?(\d+)</span>')
|
||||
@@ -141,7 +139,7 @@ def findvideos(item):
|
||||
"""
|
||||
pattern = '<iframe class="metaframe rptss" src="([^"]+)"'
|
||||
|
||||
#itemlist.append(Item(channel = __channel__, title=item.url))
|
||||
#itemlist.append(Item(channel = item.channel, title=item.url))
|
||||
for link in scrapertools.find_multiple_matches(data, pattern):
|
||||
#php.*?=(\w+)&
|
||||
#url=(.*?)&
|
||||
@@ -169,6 +167,9 @@ def findvideos(item):
|
||||
# personalizadas para Directo, se agradece, por ahora solo devuelve el primero que encuentre
|
||||
if type(link) is list:
|
||||
link = link[0]['link']
|
||||
if r'chomikuj.pl' in link:
|
||||
# En algunas personas la opcion CH les da error 401
|
||||
link += "|Referer=https://player4.cuevana2.com/plugins/gkpluginsphp.php"
|
||||
|
||||
itemlist.append(
|
||||
item.clone(
|
||||
|
||||
Reference in New Issue
Block a user