Streamingcommunity: non riprodurre ultimo contenuto quando il selezionato uscirà prossimamente
This commit is contained in:
@@ -3,10 +3,7 @@
|
||||
# Canale per AnimeSaturn
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from lib import js2py
|
||||
from core import support
|
||||
from platformcode import config
|
||||
from platformcode.logger import debug
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
__channel__ = 'animesaturn'
|
||||
|
||||
@@ -17,8 +17,7 @@ else:
|
||||
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = {}
|
||||
headers = {'user-agent':httptools.random_useragent(),
|
||||
headers = {'user-agent': httptools.random_useragent(),
|
||||
'referer': host + '/browse'}
|
||||
|
||||
# def getHeaders(forced=False):
|
||||
@@ -112,7 +111,6 @@ def newest(category):
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
logger.debug()
|
||||
if item.mainThumb: item.thumbnail = item.mainThumb
|
||||
@@ -138,7 +136,6 @@ def peliculas(item):
|
||||
headers['referer'] = host + '/search'
|
||||
records = requests.post(host + '/api/search', headers=headers, json=payload).json()['records']
|
||||
|
||||
|
||||
if records and type(records[0]) == list:
|
||||
js = []
|
||||
for record in records:
|
||||
@@ -152,7 +149,7 @@ def peliculas(item):
|
||||
else:
|
||||
recordlist.append(it)
|
||||
|
||||
itlist = [makeItem(i, it, item) for i, it in enumerate(items)]
|
||||
# itlist = [makeItem(i, it, item) for i, it in enumerate(items)]
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
itlist = [executor.submit(makeItem, i, it, item) for i, it in enumerate(items)]
|
||||
@@ -172,6 +169,7 @@ def peliculas(item):
|
||||
support.check_trakt(itemlist)
|
||||
return itemlist
|
||||
|
||||
|
||||
def makeItem(n, it, item):
|
||||
info = httptools.downloadpage(host + '/api/titles/preview/{}'.format(it['id']), headers=headers, post={}).json
|
||||
logger.debug(jsontools.dump(info))
|
||||
@@ -183,7 +181,6 @@ def makeItem(n, it, item):
|
||||
itm.language = lang
|
||||
itm.year = info['release_date'].split('-')[0]
|
||||
|
||||
|
||||
if itm.contentType == 'movie':
|
||||
# itm.contentType = 'movie'
|
||||
itm.fulltitle = itm.show = itm.contentTitle = title
|
||||
@@ -200,6 +197,7 @@ def makeItem(n, it, item):
|
||||
itm.n = n
|
||||
return itm
|
||||
|
||||
|
||||
def episodios(item):
|
||||
# getHeaders()
|
||||
logger.debug()
|
||||
@@ -238,8 +236,9 @@ def episodios(item):
|
||||
def findvideos(item):
|
||||
support.callAds('https://thaudray.com/5/3523301', host)
|
||||
# Fix for old items in videolibrary
|
||||
if item.episodeid and not item.episodeid in item.url:
|
||||
if item.episodeid and item.episodeid not in item.url:
|
||||
item.url += item.episodeid
|
||||
itemlist = [item.clone(title = channeltools.get_channel_parameters(item.channel)['title'], url=item.url, server='streamingcommunityws')]
|
||||
|
||||
itemlist = [item.clone(title=channeltools.get_channel_parameters(item.channel)['title'], url=item.url, server='streamingcommunityws')]
|
||||
return support.server(item, itemlist=itemlist, referer=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user