diff --git a/channels/animeunity.py b/channels/animeunity.py index 61ad7a49..0236890b 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -195,6 +195,7 @@ 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'), @@ -218,6 +219,6 @@ def episodios(item): def findvideos(item): - itemlist = [item.clone(title=support.config.get_localized_string(30137), server='streamingcommunityws')] + itemlist = [item.clone(title=support.config.get_localized_string(30137), server='streamingcommunityws', url=str(item.scws_id))] return support.server(item, itemlist=itemlist, referer=False) diff --git a/servers/streamingcommunityws.py b/servers/streamingcommunityws.py index 997c27fb..86d9a45e 100755 --- a/servers/streamingcommunityws.py +++ b/servers/streamingcommunityws.py @@ -6,9 +6,11 @@ from platformcode import logger, config def test_video_exists(page_url): global scws_id logger.debug('page url=', page_url) - # support.dbg() - scws_id = support.match(page_url, patron=r'scws_id[^:]+:(\d+)').match + if page_url.isdigit(): + scws_id = page_url + else: + scws_id = support.match(page_url, patron=r'scws_id[^:]+:(\d+)').match if not scws_id: return False, config.get_localized_string(70449) % 'StreamingCommunityWS' @@ -27,8 +29,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= clientIp = httptools.downloadpage('http://ip-api.com/json/').json.get('query') if clientIp: expires = int(time() + 172800) - token = b64encode(md5(f'{expires}{clientIp} Yc8U6r8KjAKAepEA'.encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_') - url = f'https://scws.work/master/{scws_id}?token={token}&expires={expires}&n=1' + token = b64encode(md5('{}{} Yc8U6r8KjAKAepEA'.format(expires, clientIp).encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_') + url = 'https://scws.work/master/{}?token={}&expires={}&n=1'.format(scws_id, token, expires) video_urls.append(['hls', url]) return video_urls