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

download_http: adding a better U-A. need this for vimeo.

This commit is contained in:
Johan Andersson 2013-03-05 23:35:00 +01:00
parent f1ff63fa4f
commit 4cca843143

View File

@ -474,7 +474,14 @@ def download_hls(options, url, baseurl=None):
def download_http(options, url): def download_http(options, url):
""" Get the stream from HTTP """ """ Get the stream from HTTP """
response = urlopen(url) request = Request(url)
request.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
try:
response = urlopen(request)
except HTTPError as e:
print "ERROR"
print e.reason
sys.exit()
try: try:
total_size = response.info()['Content-Length'] total_size = response.info()['Content-Length']
except KeyError: except KeyError: