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:
parent
f1ff63fa4f
commit
4cca843143
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user