Fix SCWS
This commit is contained in:
@@ -3,8 +3,11 @@ import sys
|
|||||||
PY3 = False
|
PY3 = False
|
||||||
if sys.version_info[0] >= 3: PY3 = True
|
if sys.version_info[0] >= 3: PY3 = True
|
||||||
|
|
||||||
if PY3: import urllib.parse as urllib
|
if PY3:
|
||||||
else: import urllib
|
import urllib.parse as urllib
|
||||||
|
else:
|
||||||
|
import urllib
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|
||||||
@@ -18,12 +21,14 @@ vttsupport = False if int(xbmc.getInfoLabel('System.BuildVersion').split('.')[0]
|
|||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
global iframeParams
|
global iframeParams
|
||||||
|
global urlParams
|
||||||
server_url = support.scrapertools.decodeHtmlentities(support.match(page_url, patron=['<iframe [^>]+src="([^"]+)', 'embed_url="([^"]+)']).match)
|
server_url = support.scrapertools.decodeHtmlentities(support.match(page_url, patron=['<iframe [^>]+src="([^"]+)', 'embed_url="([^"]+)']).match)
|
||||||
iframeParams = support.match(server_url, patron=r'''"quality":(\d+)[^;]+;\s+window\.masterPlaylist\s+=\s+{[^{]+({[^}]+}),\s+url:\s+'([^']+)''').match
|
iframeParams = support.match(server_url, patron=r'''"quality":(\d+)[^;]+;\s+window\.masterPlaylist\s+=\s+{[^{]+({[^}]+}),\s+url:\s+'([^']+)''').match
|
||||||
|
|
||||||
if not iframeParams or len(iframeParams) < 2:
|
if not iframeParams or len(iframeParams) < 2:
|
||||||
return 'StreamingCommunity', 'Prossimamente'
|
return 'StreamingCommunity', 'Prossimamente'
|
||||||
|
|
||||||
|
urlParams = urllib.parse_qs(urllib.urlsplit(server_url).query)
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
|
|
||||||
@@ -33,8 +38,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
quality, params, url = iframeParams
|
quality, params, url = iframeParams
|
||||||
|
|
||||||
masterPlaylistParams = ast.literal_eval(params)
|
masterPlaylistParams = ast.literal_eval(params)
|
||||||
masterPlaylistParams['h'] = 1
|
if urlParams['canPlayFHD']:
|
||||||
if quality == '720':
|
masterPlaylistParams['h'] = 1
|
||||||
|
if urlParams['b']:
|
||||||
masterPlaylistParams['b'] = 1
|
masterPlaylistParams['b'] = 1
|
||||||
url = '{}?{}'.format(url,urllib.urlencode(masterPlaylistParams))
|
url = '{}?{}'.format(url,urllib.urlencode(masterPlaylistParams))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user