Merge remote-tracking branch 'origin/master'
This commit is contained in:
+4
-3
@@ -9,7 +9,7 @@ from platformcode import logger, config
|
|||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
logger.debug("(page_url='%s')" % page_url)
|
logger.debug("(page_url='%s')" % page_url)
|
||||||
|
global data
|
||||||
data = httptools.downloadpage(page_url).data
|
data = httptools.downloadpage(page_url).data
|
||||||
if "copyrightsRestricted" in data or "COPYRIGHTS_RESTRICTED" in data:
|
if "copyrightsRestricted" in data or "COPYRIGHTS_RESTRICTED" in data:
|
||||||
return False, config.get_localized_string(70449) % "OKru"
|
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)
|
logger.debug("url=" + page_url)
|
||||||
video_urls = []
|
video_urls = []
|
||||||
|
|
||||||
data = httptools.downloadpage(page_url).data
|
# data = httptools.downloadpage(page_url).data
|
||||||
|
global data
|
||||||
data = scrapertools.decodeHtmlentities(data).replace('\\', '')
|
data = scrapertools.decodeHtmlentities(data).replace('\\', '')
|
||||||
# URL del vídeo
|
# URL del vídeo
|
||||||
for type, url in re.findall(r'\{"name":"([^"]+)","url":"([^"]+)"', data, re.DOTALL):
|
for type, url in re.findall(r'\{"name":"([^"]+)","url":"([^"]+)"', data, re.DOTALL):
|
||||||
url = url.replace("%3B", ";").replace("u0026", "&")
|
url = url.replace("%3B", ";").replace("u0026", "&")
|
||||||
video_urls.append([type + " [OKru]", url])
|
video_urls.append([type + " [OKru]", url + '|Referrer=' + page_url])
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|||||||
+12
-9
@@ -3,16 +3,16 @@
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core.support import match, info, server
|
from core.support import match, info, server
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger, platformtools
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
info()
|
info()
|
||||||
|
|
||||||
itemlist = []
|
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(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'))
|
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))
|
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60091), thumbnail=item.thumbnail, folder=False))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -33,12 +33,15 @@ def search(item, text):
|
|||||||
itemlist = server(item, itemlist=itemlist)
|
itemlist = server(item, itemlist=itemlist)
|
||||||
else:
|
else:
|
||||||
data = match(text).data
|
data = match(text).data
|
||||||
itemlist = servertools.find_video_items(data=data)
|
itemlist = server(item, data=data)
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
item.channel = "url"
|
item.channel = "url"
|
||||||
item.action = "play"
|
item.action = "play"
|
||||||
|
|
||||||
if len(itemlist) == 0:
|
if itemlist:
|
||||||
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60093)))
|
if len(itemlist) == 1:
|
||||||
|
from platformcode.launcher import play
|
||||||
return itemlist
|
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