Fix Pluto TV
This commit is contained in:
+8
-4
@@ -6,7 +6,7 @@
|
|||||||
import uuid, datetime
|
import uuid, datetime
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core import support, httptools
|
from core import jsontools, support, httptools
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
@@ -14,17 +14,20 @@ api = 'https://api.pluto.tv'
|
|||||||
UUID = 'sid={}&deviceId={}'.format(uuid.uuid1().hex, uuid.uuid4().hex)
|
UUID = 'sid={}&deviceId={}'.format(uuid.uuid1().hex, uuid.uuid4().hex)
|
||||||
vod_url = '{}/v3/vod/categories?includeItems=true&deviceType=web&'.format(api, UUID)
|
vod_url = '{}/v3/vod/categories?includeItems=true&deviceType=web&'.format(api, UUID)
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Dirette {bold}', ['/it/live-tv/', 'live'])]
|
top = [('Dirette {bold}', ['/it/live-tv/', 'live'])]
|
||||||
|
|
||||||
menu = sorted([(it['name'], ['/it/on-demand', 'peliculas', it['items']]) for it in httptools.downloadpage(vod_url).json['categories'][1:]])
|
menu = [('Categorie', ['', 'category'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
@support.menu
|
||||||
|
def category(item):
|
||||||
|
menu = sorted([(it['name'], ['/it/on-demand', 'peliculas', it['items']]) for it in httptools.downloadpage(vod_url).json['categories'][1:]])
|
||||||
|
return locals()
|
||||||
|
|
||||||
def live(item):
|
def live(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
@@ -75,6 +78,7 @@ def peliculas(item):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
recordlist = []
|
recordlist = []
|
||||||
|
|
||||||
for i, it in enumerate(item.args):
|
for i, it in enumerate(item.args):
|
||||||
if item.search in it['name'].lower():
|
if item.search in it['name'].lower():
|
||||||
itm = Item(channel=item.channel,
|
itm = Item(channel=item.channel,
|
||||||
@@ -88,7 +92,7 @@ def peliculas(item):
|
|||||||
thumbnail= it['covers'][0]['url'],
|
thumbnail= it['covers'][0]['url'],
|
||||||
fanart= it['covers'][2]['url'] if len(it['covers']) > 2 else '',
|
fanart= it['covers'][2]['url'] if len(it['covers']) > 2 else '',
|
||||||
id= it['_id'],
|
id= it['_id'],
|
||||||
videourl= it['stitched']['urls'][0]['url'].split('?')[0])
|
videourl= it.get('stitched', {}).get('urls', [{}])[0].get('url','').split('?')[0])
|
||||||
|
|
||||||
if i < 20 or item.search:
|
if i < 20 or item.search:
|
||||||
itemlist.append(itm)
|
itemlist.append(itm)
|
||||||
|
|||||||
Reference in New Issue
Block a user