Fix Risoluzioni SCWS

This commit is contained in:
Alhaziel01
2023-06-18 21:58:21 +02:00
parent 62d63483d4
commit 18ee7b3c17

View File

@@ -27,7 +27,6 @@ def test_video_exists(page_url):
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
urls = list()
subs = list()
composed_subs = list()
local_subs = list()
video_urls = list()
@@ -35,15 +34,15 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
masterPlaylistParams = ast.literal_eval(iframeParams)
url = 'https://scws.work/v2/playlist/{}?{}&n=1'.format(scws_id, urllib.parse.urlencode(masterPlaylistParams))
info = support.match(url, patron=r'LANGUAGE="([^"]+)",\s*URI="([^"]+)|(?:RESOLUTION=\d+x|BANDWIDTH=)?(\d+).*?(http[^"\s]+)').matches
info = support.match(url, patron=r'LANGUAGE="([^"]+)",\s*URI="([^"]+)|BANDWIDTH=(\d+).+?(?:RESOLUTION=\d+x(\d+))?[^ ]+ (http[^"\s]+)').matches
if info:
for lang, sub, res, url in info:
for lang, sub, band, res, url in info:
if sub:
if lang == 'auto': lang = 'ita-forced'
subs.append([lang, sub])
elif not 'token=&' in url:
urls.append([res, url])
urls.append([res if res else band, url])
if subs:
local_subs = subs_downloader(subs)