1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

utils.request: send chrome user-agent instead of the default one

This commit is contained in:
Johan Andersson 2015-10-04 14:33:08 +02:00
parent 28581838b0
commit 64b2ac0240

View File

@ -37,8 +37,9 @@ class HTTP(Session):
return self.get(url, stream=True).url return self.get(url, stream=True).url
def request(self, method, url, *args, **kwargs): def request(self, method, url, *args, **kwargs):
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.3"}
log.debug("HTTP getting %r", url) log.debug("HTTP getting %r", url)
res = Session.request(self, method, url, **kwargs) res = Session.request(self, method, url, headers=headers, *args, **kwargs)
return res return res