From 471e4d6063a837de7a6e3e5599da865148ada5af Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 29 Nov 2023 00:01:17 +0100 Subject: [PATCH] http: remove range because we dont need it all the time for some reason once you set it, it will be in every request after it. --- lib/svtplay_dl/utils/http.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/svtplay_dl/utils/http.py b/lib/svtplay_dl/utils/http.py index 805d3e7..caae4cb 100644 --- a/lib/svtplay_dl/utils/http.py +++ b/lib/svtplay_dl/utils/http.py @@ -41,6 +41,9 @@ class HTTP(Session): if headers: for i in headers.keys(): self.headers[i] = headers[i] + else: + if "Range" in self.headers: # for some reason headers is always there for each request + del self.headers["Range"] # need to remove it because we dont want it logging.debug("HTTP getting %r", url) res = Session.request(self, method, url, verify=self.verify, proxies=self.proxy, *args, **kwargs) return res