Streamingcommunity nuovo player
This commit is contained in:
@@ -223,7 +223,7 @@ def episodios(item):
|
||||
action='findvideos',
|
||||
contentType='episode',
|
||||
contentSerieName=item.fulltitle,
|
||||
url='{}/watch/{}?e={}'.format(host, se['title_id'], ep['id'])))
|
||||
url='{}/iframe/{}?episode_id={}'.format(host, se['title_id'], ep['id'])))
|
||||
|
||||
if config.get_setting('episode_info') and not support.stackCheck(['add_tvshow', 'get_newest']):
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
@@ -235,10 +235,8 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
support.callAds('https://thaudray.com/5/3523301', host)
|
||||
# Fix for old items in videolibrary
|
||||
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.replace('/watch/', '/iframe/'), server='streamingcommunityws')]
|
||||
return support.server(item, itemlist=itemlist, referer=False)
|
||||
|
||||
|
||||
@@ -1,56 +1,51 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import urllib.parse
|
||||
|
||||
from core import httptools, support, filetools
|
||||
from platformcode import logger, config
|
||||
UA = httptools.random_useragent()
|
||||
import ast
|
||||
UA = httptools.get_user_agent()
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
global scws_id
|
||||
logger.debug('page url=', page_url)
|
||||
scws_id = ''
|
||||
|
||||
if page_url.isdigit():
|
||||
scws_id = page_url
|
||||
else:
|
||||
page = httptools.downloadpage(page_url)
|
||||
if page.url == page_url: # se non esiste, reindirizza all'ultimo url chiamato esistente
|
||||
scws_id = support.scrapertools.find_single_match(page.data, r'scws_id[^:]+:(\d+)')
|
||||
else:
|
||||
return 'StreamingCommunity', 'Prossimamente'
|
||||
|
||||
if not scws_id:
|
||||
return False, config.get_localized_string(70449) % 'StreamingCommunityWS'
|
||||
# logger.debug('page url=', page_url)
|
||||
# scws_id = ''
|
||||
#
|
||||
# if page_url.isdigit():
|
||||
# scws_id = page_url
|
||||
# else:
|
||||
# page = httptools.downloadpage(page_url)
|
||||
# if page.url == page_url: # se non esiste, reindirizza all'ultimo url chiamato esistente
|
||||
# scws_id = support.scrapertools.find_single_match(page.data, r'scws_id[^:]+:(\d+)')
|
||||
# else:
|
||||
# return 'StreamingCommunity', 'Prossimamente'
|
||||
#
|
||||
# if not scws_id:
|
||||
# return False, config.get_localized_string(70449) % 'StreamingCommunityWS'
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
from time import time
|
||||
from base64 import b64encode
|
||||
from hashlib import md5
|
||||
|
||||
global scws_id
|
||||
from urllib.parse import urlparse
|
||||
video_urls = list()
|
||||
iframe = support.scrapertools.decodeHtmlentities(support.match(page_url, patron='<iframe [^>]+src="([^"]+)').match)
|
||||
scws_id = urlparse(iframe).path.split('/')[-1]
|
||||
masterPlaylistParams = ast.literal_eval(support.match(iframe, patron='window\.masterPlaylistParams\s=\s({.*?})').match)
|
||||
|
||||
# clientIp = httptools.downloadpage(f'https://scws.work/videos/{scws_id}').json.get('client_ip')
|
||||
clientIp = httptools.downloadpage('http://ip-api.com/json/').json.get('query')
|
||||
if clientIp:
|
||||
expires = int(time() + 172800)
|
||||
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)
|
||||
if page_url.isdigit():
|
||||
video_urls.append(['m3u8', '{}|User-Agent={}'.format(url, UA)])
|
||||
else:
|
||||
video_urls = compose(url)
|
||||
url = 'https://scws.work/v2/playlist/{}?{}&n=1'.format(scws_id, urllib.parse.urlencode(masterPlaylistParams))
|
||||
video_urls.append(['m3u8', '{}|User-Agent={}'.format(url, UA)])
|
||||
|
||||
return video_urls
|
||||
|
||||
|
||||
def compose(url):
|
||||
subs = []
|
||||
video_urls = []
|
||||
info = support.match(url, patron=r'LANGUAGE="([^"]+)",\s*URI="([^"]+)|RESOLUTION=\d+x(\d+).*?(http[^"\s]+)', headers={'User-Agent':UA}).matches
|
||||
if info and not logger.testMode: # ai test non piace questa parte
|
||||
for lang, sub, res, url in info:
|
||||
if sub:
|
||||
if sub:
|
||||
while True:
|
||||
match = support.match(sub, patron=r'(http[^\s\n]+)').match
|
||||
if match:
|
||||
|
||||
Reference in New Issue
Block a user