Update ohpelis.py
This commit is contained in:
@@ -14,18 +14,19 @@ from core.item import Item
|
|||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = 'http://www.ohpelis.com'
|
host = 'http://www.ohpelis.com'
|
||||||
headers = {
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Chrome/58.0.3029.110',
|
|
||||||
'Referer': host}
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(host).data
|
||||||
|
patron = '<li class="cat-item cat-item-\d+"><a href="(.*?)" >(.*?)<\/a> <i>(\d+)<\/i>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
mcantidad = 0
|
||||||
|
for scrapedurl, scrapedtitle, cantidad in matches:
|
||||||
|
mcantidad += int(cantidad)
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title="Peliculas",
|
item.clone(title="Peliculas (%s)" %mcantidad,
|
||||||
action='movies_menu'
|
action='movies_menu'
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -95,14 +96,14 @@ def list_all(item):
|
|||||||
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedplot in matches:
|
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedplot in matches:
|
||||||
title = scrapedtitle
|
title = scrapedtitle
|
||||||
plot = scrapedplot
|
|
||||||
thumbnail = scrapedthumbnail
|
thumbnail = scrapedthumbnail
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
year = scrapedyear
|
year = scrapedyear
|
||||||
new_item = (item.clone(title=title,
|
new_item = (item.clone(title=title,
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
plot=plot,
|
fulltitle=title,
|
||||||
|
contentTitle=title,
|
||||||
infoLabels={'year': year}
|
infoLabels={'year': year}
|
||||||
))
|
))
|
||||||
if item.extra == 'serie':
|
if item.extra == 'serie':
|
||||||
@@ -114,7 +115,7 @@ def list_all(item):
|
|||||||
|
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels(itemlist, True)
|
||||||
# Paginacion
|
# Paginacion
|
||||||
next_page = scrapertools.find_single_match(data, '<link rel="next" href="(.*?) />')
|
next_page = scrapertools.find_single_match(data, '<link rel="next" href="(.*?) />')
|
||||||
if next_page:
|
if next_page:
|
||||||
@@ -162,7 +163,6 @@ def search_list(item):
|
|||||||
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedtype, scrapedyear, scrapedplot in matches:
|
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedtype, scrapedyear, scrapedplot in matches:
|
||||||
title = scrapedtitle
|
title = scrapedtitle
|
||||||
plot = scrapedplot
|
|
||||||
thumbnail = scrapedthumbnail
|
thumbnail = scrapedthumbnail
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
year = scrapedyear
|
year = scrapedyear
|
||||||
@@ -170,7 +170,6 @@ def search_list(item):
|
|||||||
title=title,
|
title=title,
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
plot=plot,
|
|
||||||
infoLabels={'year': year})
|
infoLabels={'year': year})
|
||||||
if scrapedtype == 'movies':
|
if scrapedtype == 'movies':
|
||||||
new_item.action = 'findvideos'
|
new_item.action = 'findvideos'
|
||||||
@@ -275,11 +274,14 @@ def findvideos(item):
|
|||||||
itemlist.extend(servertools.find_video_items(data=data))
|
itemlist.extend(servertools.find_video_items(data=data))
|
||||||
for videoitem in itemlist:
|
for videoitem in itemlist:
|
||||||
videoitem.channel = item.channel
|
videoitem.channel = item.channel
|
||||||
|
videoitem.contentTitle = item.fulltitle
|
||||||
|
videoitem.infoLabels = item.infoLabels
|
||||||
if videoitem.server != 'youtube':
|
if videoitem.server != 'youtube':
|
||||||
videoitem.title = item.title + ' (%s)' % videoitem.server
|
videoitem.title = item.title + ' (%s)' % videoitem.server
|
||||||
else:
|
else:
|
||||||
videoitem.title = 'Trailer en %s' % videoitem.server
|
videoitem.title = 'Trailer en %s' % videoitem.server
|
||||||
videoitem.action = 'play'
|
videoitem.action = 'play'
|
||||||
|
videoitem.server = ""
|
||||||
|
|
||||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -288,9 +290,9 @@ def findvideos(item):
|
|||||||
url=item.url,
|
url=item.url,
|
||||||
action="add_pelicula_to_library",
|
action="add_pelicula_to_library",
|
||||||
extra="findvideos",
|
extra="findvideos",
|
||||||
contentTitle=item.contentTitle,
|
|
||||||
))
|
))
|
||||||
|
tmdb.set_infoLabels(itemlist, True)
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -314,3 +316,8 @@ def newest(categoria):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
logger.info()
|
||||||
|
item.thumbnail = item.contentThumbnail
|
||||||
|
return [item]
|
||||||
|
|||||||
Reference in New Issue
Block a user