fix streamtape e polpotv
This commit is contained in:
@@ -7,15 +7,13 @@
|
||||
from core import support, jsontools
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
import json, datetime
|
||||
import datetime
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
headers = [['Accept', 'application/ld+json']]
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
# menu = [
|
||||
@@ -57,8 +55,9 @@ def peliculas(item):
|
||||
item.contentType='movie'
|
||||
else:
|
||||
item.contentType='tvshow'
|
||||
itemlist.extend(get_itemlist_element(element, item))
|
||||
itemlist.append(get_itemlist_element(element, item))
|
||||
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
try:
|
||||
if support.inspect.stack()[1][3] not in ['newest']:
|
||||
support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next'])
|
||||
@@ -106,13 +105,14 @@ def search(item, texto):
|
||||
json_object = jsontools.load(data)
|
||||
for movie in json_object['hydra:member']:
|
||||
item.contentType='movie'
|
||||
itemlist.extend(get_itemlist_element(movie,item))
|
||||
itemlist.append(get_itemlist_element(movie,item))
|
||||
item.url = host + "/api/shows?originalTitle="+texto+"&translations.name=" +texto
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for tvshow in json_object['hydra:member']:
|
||||
item.contentType='tvshow'
|
||||
itemlist.extend(get_itemlist_element(tvshow,item))
|
||||
itemlist.append(get_itemlist_element(tvshow,item))
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
return itemlist
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
@@ -121,6 +121,7 @@ def search(item, texto):
|
||||
support.logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def search_movie_by_genre(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
@@ -134,6 +135,7 @@ def search_movie_by_genre(item):
|
||||
url="%s/api/movies?genres.id=%s" %(host,genre['id'])))
|
||||
return support.thumb(itemlist, True)
|
||||
|
||||
|
||||
def search_movie_by_year(item):
|
||||
support.info()
|
||||
now = datetime.datetime.now()
|
||||
@@ -149,6 +151,7 @@ def search_movie_by_year(item):
|
||||
action="peliculas"))
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
@@ -170,9 +173,9 @@ def findvideos(item):
|
||||
pass
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
def get_itemlist_element(element,item):
|
||||
support.info()
|
||||
itemlist=[]
|
||||
contentSerieName = ''
|
||||
contentTitle =''
|
||||
try:
|
||||
@@ -189,13 +192,13 @@ def get_itemlist_element(element,item):
|
||||
except:
|
||||
scrapedplot = ""
|
||||
try:
|
||||
scrapedthumbnail="http://"+element['posterPath']
|
||||
scrapedthumbnail="https:"+element['bestPosters'].values()[0]
|
||||
except:
|
||||
scrapedthumbnail=""
|
||||
try:
|
||||
scrapedfanart="http://"+element['backdropPath']
|
||||
except:
|
||||
scrapedfanart=""
|
||||
# try:
|
||||
# scrapedfanart="http:"+element['backdropPath']
|
||||
# except:
|
||||
# scrapedfanart=""
|
||||
|
||||
infoLabels = {}
|
||||
if item.contentType=='movie':
|
||||
@@ -210,20 +213,15 @@ def get_itemlist_element(element,item):
|
||||
quality=''
|
||||
url="%s%s"
|
||||
|
||||
if item.contentType=='movie':
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist)
|
||||
itemlist.append(
|
||||
item.clone(action=next_action,
|
||||
return item.clone(action=next_action,
|
||||
title=support.typo(scrapedtitle, 'bold') + quality,
|
||||
fulltitle=scrapedtitle,
|
||||
show=scrapedtitle,
|
||||
plot=scrapedplot,
|
||||
fanart=scrapedfanart,
|
||||
# fanart=scrapedfanart,
|
||||
thumbnail=scrapedthumbnail,
|
||||
contentTitle=contentTitle,
|
||||
contentSerieName=contentSerieName,
|
||||
contentType=item.contentType,
|
||||
url=url % (host, element['@id']),
|
||||
infoLabels=infoLabels))
|
||||
|
||||
return itemlist
|
||||
infoLabels=infoLabels)
|
||||
|
||||
@@ -1,27 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# --------------------------------------------------------
|
||||
# Conector streamtape By Alfa development Group
|
||||
# --------------------------------------------------------
|
||||
import re
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from platformcode import logger, config
|
||||
from platformcode import logger
|
||||
import sys
|
||||
|
||||
PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
|
||||
referer = {"Referer": page_url}
|
||||
|
||||
data = httptools.downloadpage(page_url, headers=referer).data
|
||||
|
||||
if "Video not found" in data:
|
||||
return False, config.get_localized_string(70449) % "Streamtape"
|
||||
return False, "[streamtape] 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 = []
|
||||
global data
|
||||
|
||||
url = scrapertools.find_single_match(data, 'id="videolink"[^>]+>\n?\s*//(.*?)<')
|
||||
if url:
|
||||
media_url = 'https://' + url + '&stream=1'
|
||||
video_urls.append([".mp4 [Streamtape]", media_url])
|
||||
|
||||
return video_urls
|
||||
url = "https:" + scrapertools.find_single_match(data, 'innerHTML = "([^"]+)')
|
||||
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "")
|
||||
video_urls.append(['MP4 [streamtape]', url])
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user