Fix animeunity
This commit is contained in:
@@ -153,6 +153,8 @@ def peliculas(item):
|
||||
|
||||
payload = json.dumps(item.args)
|
||||
records = httptools.downloadpage(host + '/archivio/get-animes', headers=headers, post=payload).json['records']
|
||||
# support.dbg()
|
||||
|
||||
for it in records:
|
||||
if not it['title']:
|
||||
it['title'] = ''
|
||||
@@ -170,7 +172,7 @@ def peliculas(item):
|
||||
itm.type = it['type']
|
||||
itm.thumbnail = it['imageurl']
|
||||
itm.plot = it['plot']
|
||||
itm.url = item.url
|
||||
itm.url = '{}/anime/{}-{}'.format(item.url, it.get('id'), it.get('slug'))
|
||||
|
||||
if it['episodes_count'] == 1:
|
||||
itm.contentType = 'movie'
|
||||
@@ -199,7 +201,6 @@ def episodios(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
||||
|
||||
for it in item.episodes:
|
||||
itemlist.append(
|
||||
item.clone(title=support.typo(title + it['number'], 'bold'),
|
||||
@@ -224,28 +225,33 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
if item.scws_id:
|
||||
from time import time
|
||||
from base64 import b64encode
|
||||
from hashlib import md5
|
||||
# if item.scws_id:
|
||||
# from time import time
|
||||
# from base64 import b64encode
|
||||
# from hashlib import md5
|
||||
#
|
||||
# client_ip = support.httptools.downloadpage('http://ip-api.com/json/').json.get('query')
|
||||
#
|
||||
# expires = int(time() + 172800)
|
||||
# token = b64encode(md5('{}{} Yc8U6r8KjAKAepEA'.format(expires, client_ip).encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_')
|
||||
#
|
||||
# url = 'https://scws.work/master/{}?token={}&expires={}&n=1'.format(item.scws_id, token, expires)
|
||||
#
|
||||
# itemlist = [item.clone(title=support.config.get_localized_string(30137), url=url, server='directo', action='play')]
|
||||
|
||||
client_ip = support.httptools.downloadpage('http://ip-api.com/json/').json.get('query')
|
||||
from core import channeltools
|
||||
itemlist = [item.clone(title=channeltools.get_channel_parameters(item.channel)['title'],
|
||||
url=item.url, server='streamingcommunityws')]
|
||||
return support.server(item, itemlist=itemlist, referer=False)
|
||||
|
||||
expires = int(time() + 172800)
|
||||
token = b64encode(md5('{}{} Yc8U6r8KjAKAepEA'.format(expires, client_ip).encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_')
|
||||
# return support.server(item, itemlist=itemlist)
|
||||
|
||||
url = 'https://scws.work/master/{}?token={}&expires={}&n=1'.format(item.scws_id, token, expires)
|
||||
|
||||
itemlist = [item.clone(title=support.config.get_localized_string(30137), url=url, server='directo', action='play')]
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
def play(item):
|
||||
urls = list()
|
||||
info = support.match(item.url, patron=r'(http.*?rendition=(\d+)[^\s]+)').matches
|
||||
|
||||
if info:
|
||||
for url, res in info:
|
||||
urls.append(['hls [{}]'.format(res), url])
|
||||
return urls
|
||||
#
|
||||
# def play(item):
|
||||
# urls = list()
|
||||
# info = support.match(item.url, patron=r'(http.*?rendition=(\d+)[^\s]+)').matches
|
||||
#
|
||||
# if info:
|
||||
# for url, res in info:
|
||||
# urls.append(['hls [{}]'.format(res), url])
|
||||
# return urls
|
||||
@@ -6,17 +6,20 @@ import xbmc
|
||||
from core import httptools, support, filetools
|
||||
from platformcode import logger, config
|
||||
from concurrent import futures
|
||||
from urllib.parse import urlparse
|
||||
|
||||
vttsupport = False if int(xbmc.getInfoLabel('System.BuildVersion').split('.')[0]) < 20 else True
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
global iframe
|
||||
global server_url
|
||||
global iframeParams
|
||||
|
||||
iframe = support.scrapertools.decodeHtmlentities(support.match(page_url, patron='<iframe [^>]+src="([^"]+)').match)
|
||||
iframeParams = support.match(iframe, patron=['window.masterPlaylist\s=\s{\s.*params:\s((?s:.*})),','},\s*url:\s.(http.*).,']).matches
|
||||
server_url = support.scrapertools.decodeHtmlentities(support.match(page_url, patron='<iframe [^>]+src="([^"]+)').match)
|
||||
if not server_url:
|
||||
server_url = support.match(page_url, patron='embed_url="([^"]+)').match
|
||||
iframeParams = support.match(server_url, patron=['window.masterPlaylist\s=\s{\s.*params:\s(.*?}),',
|
||||
'''},\s*url:\s.(http[^"']+).,''']).matches
|
||||
logger.info(iframeParams)
|
||||
|
||||
if not iframeParams or len(iframeParams) < 2:
|
||||
return 'StreamingCommunity', 'Prossimamente'
|
||||
@@ -30,7 +33,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
local_subs = list()
|
||||
video_urls = list()
|
||||
|
||||
scws_id = urlparse(iframe).path.split('/')[-1]
|
||||
# scws_id = urlparse(server_url).path.split('/')[-1]
|
||||
masterPlaylistParams = ast.literal_eval(iframeParams[0])
|
||||
url = iframeParams[1] + '?{}&n=1'.format(urllib.parse.urlencode(masterPlaylistParams))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user