From 1c47b0602c8cc8b6e58ab5ff4bab22b9b91aef21 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 16 May 2021 10:20:05 +0200 Subject: [PATCH] viafree: modify the hls url little bit --- lib/svtplay_dl/service/viaplay.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index 4f921f8..d4106fc 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -7,6 +7,7 @@ import hashlib import json import logging import re +from urllib.parse import parse_qs from urllib.parse import urlparse from svtplay_dl.error import ServiceError @@ -78,10 +79,15 @@ class Viafree(Service, OpenGraphThumbMixin): stream = janson["embedded"]["prioritizedStreams"][0]["links"]["stream"] if video["_embedded"]["program"]["_links"]["streamLink"]: + parse = urlparse(stream["href"]) + query = parse_qs(parse.query) + query.pop("filter", None) + query = "&".join(f"{key}={val[0]}".format(key, val) for (key, val) in query.items()) + hls_url = f"https://{parse.netloc}{parse.path}?{query}" yield from hlsparse( self.config, - self.http.request("get", stream["href"]), - stream["href"], + self.http.request("get", hls_url), + hls_url, output=self.output, authorization=f"MTG-AT {self.token}", )