Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -9,7 +9,7 @@ from platformcode import logger, config
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.debug("(page_url='%s')" % page_url)
|
||||
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "copyrightsRestricted" in data or "COPYRIGHTS_RESTRICTED" in data:
|
||||
return False, config.get_localized_string(70449) % "OKru"
|
||||
@@ -23,11 +23,12 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
logger.debug("url=" + page_url)
|
||||
video_urls = []
|
||||
|
||||
data = httptools.downloadpage(page_url).data
|
||||
# data = httptools.downloadpage(page_url).data
|
||||
global data
|
||||
data = scrapertools.decodeHtmlentities(data).replace('\\', '')
|
||||
# URL del vídeo
|
||||
for type, url in re.findall(r'\{"name":"([^"]+)","url":"([^"]+)"', data, re.DOTALL):
|
||||
url = url.replace("%3B", ";").replace("u0026", "&")
|
||||
video_urls.append([type + " [OKru]", url])
|
||||
video_urls.append([type + " [OKru]", url + '|Referrer=' + page_url])
|
||||
|
||||
return video_urls
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
from core import servertools
|
||||
from core.support import match, info, server
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
from platformcode import config, logger, platformtools
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
info()
|
||||
|
||||
itemlist = []
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089), thumbnail=item.thumbnail, args='server'))
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60090), thumbnail=item.thumbnail, args='direct'))
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60091), thumbnail=item.thumbnail))
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089), thumbnail=item.thumbnail, args='server', folder=False))
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60090), thumbnail=item.thumbnail, args='direct', folder=False))
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60091), thumbnail=item.thumbnail, folder=False))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -33,12 +33,15 @@ def search(item, text):
|
||||
itemlist = server(item, itemlist=itemlist)
|
||||
else:
|
||||
data = match(text).data
|
||||
itemlist = servertools.find_video_items(data=data)
|
||||
itemlist = server(item, data=data)
|
||||
for item in itemlist:
|
||||
item.channel = "url"
|
||||
item.action = "play"
|
||||
|
||||
if len(itemlist) == 0:
|
||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60093)))
|
||||
|
||||
return itemlist
|
||||
if itemlist:
|
||||
if len(itemlist) == 1:
|
||||
from platformcode.launcher import play
|
||||
play(itemlist[0].clone(no_return=True))
|
||||
platformtools.serverWindow(item, itemlist)
|
||||
else:
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60347))
|
||||
|
||||
Reference in New Issue
Block a user