Fix StreamingCommunity
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"id": "streamingcommunity",
|
"id": "streamingcommunity",
|
||||||
"name": "Streaming Community",
|
"name": "StreamingCommunity",
|
||||||
"active": true,
|
"active": true,
|
||||||
"language": ["ita"],
|
"language": ["ita"],
|
||||||
"thumbnail": "streamingcommunity.png",
|
"thumbnail": "streamingcommunity.png",
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
# Canale per StreamingCommunity
|
# Canale per StreamingCommunity
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import json, requests
|
import json, requests, sys
|
||||||
from core import support
|
from core import support
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
if sys.version_info[0] >= 3:
|
||||||
|
from concurrent import futures
|
||||||
|
else:
|
||||||
|
from concurrent_py2 import futures
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
@@ -117,42 +121,49 @@ def peliculas(item):
|
|||||||
js += record
|
js += record
|
||||||
else:
|
else:
|
||||||
js = records
|
js = records
|
||||||
|
# support.dbg()
|
||||||
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
|
for i, it in enumerate(js):
|
||||||
|
itm = executor.submit(makeItem, i, it, item).result()
|
||||||
|
itemlist.append(itm)
|
||||||
|
# for i, it in enumerate(js):
|
||||||
|
# itm = makeItem(i, it, item)
|
||||||
|
# itemlist.append(itm)
|
||||||
|
|
||||||
for it in js:
|
itemlist.sort(key=lambda item: item.n, reverse = True)
|
||||||
title, lang = support.match(it['name'], patron=r'([^\[|$]+)(?:\[([^\]]+)\])?').match
|
|
||||||
if not lang:
|
|
||||||
lang = 'ITA'
|
|
||||||
itm = item.clone(title=support.typo(title,'bold') + support.typo(lang,'_ [] color kod bold'))
|
|
||||||
itm.type = it['type']
|
|
||||||
itm.thumbnail = 'https://image.tmdb.org/t/p/w500' + it['images'][0]['url']
|
|
||||||
itm.fanart = 'https://image.tmdb.org/t/p/w1280' + it['images'][2]['url']
|
|
||||||
itm.plot = it['plot']
|
|
||||||
itm.infoLabels['tmdb_id'] = it['tmdb_id']
|
|
||||||
itm.language = lang
|
|
||||||
|
|
||||||
|
|
||||||
if itm.type == 'movie':
|
|
||||||
itm.contentType = 'movie'
|
|
||||||
itm.fulltitle = itm.show = itm.contentTitle = title
|
|
||||||
itm.contentSerieName = ''
|
|
||||||
itm.action = 'findvideos'
|
|
||||||
itm.url = host + '/watch/%s' % it['id']
|
|
||||||
|
|
||||||
else:
|
|
||||||
itm.contentType = 'tvshow'
|
|
||||||
itm.contentTitle = ''
|
|
||||||
itm.fulltitle = itm.show = itm.contentSerieName = title
|
|
||||||
itm.action = 'episodios'
|
|
||||||
itm.season_count = it['seasons_count']
|
|
||||||
itm.url = host + '/titles/%s-%s' % (it['id'], it['slug'])
|
|
||||||
|
|
||||||
itemlist.append(itm)
|
|
||||||
|
|
||||||
if len(itemlist) >= 60:
|
if len(itemlist) >= 60:
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1))
|
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1))
|
||||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def makeItem(n, it, item):
|
||||||
|
info = session.post(host + '/api/titles/preview/{}'.format(it['id']), headers=headers).json()
|
||||||
|
title, lang = support.match(info['name'], patron=r'([^\[|$]+)(?:\[([^\]]+)\])?').match
|
||||||
|
if not lang:
|
||||||
|
lang = 'ITA'
|
||||||
|
itm = item.clone(title=support.typo(title,'bold') + support.typo(lang,'_ [] color kod bold'))
|
||||||
|
itm.type = info['type']
|
||||||
|
itm.language = lang
|
||||||
|
|
||||||
|
|
||||||
|
if itm.type == 'movie':
|
||||||
|
itm.contentType = 'movie'
|
||||||
|
itm.fulltitle = itm.show = itm.contentTitle = title
|
||||||
|
itm.contentTitle = ''
|
||||||
|
itm.action = 'findvideos'
|
||||||
|
itm.url = host + '/watch/%s' % it['id']
|
||||||
|
|
||||||
|
else:
|
||||||
|
itm.contentType = 'tvshow'
|
||||||
|
itm.contentTitle = ''
|
||||||
|
itm.fulltitle = itm.show = itm.contentSerieName = title
|
||||||
|
itm.action = 'episodios'
|
||||||
|
itm.season_count = info['seasons_count']
|
||||||
|
itm.url = host + '/titles/%s-%s' % (it['id'], it['slug'])
|
||||||
|
item.n = n
|
||||||
|
return itm
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
getHeaders()
|
getHeaders()
|
||||||
support.info()
|
support.info()
|
||||||
|
|||||||
Reference in New Issue
Block a user