1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-23 19:55:38 +01:00

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.
This commit is contained in:
Johan Andersson 2023-11-29 00:01:17 +01:00
parent 924cc0dd50
commit 471e4d6063

View File

@ -41,6 +41,9 @@ class HTTP(Session):
if headers: if headers:
for i in headers.keys(): for i in headers.keys():
self.headers[i] = headers[i] 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) logging.debug("HTTP getting %r", url)
res = Session.request(self, method, url, verify=self.verify, proxies=self.proxy, *args, **kwargs) res = Session.request(self, method, url, verify=self.verify, proxies=self.proxy, *args, **kwargs)
return res return res