summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eff855e)
This avoids annoying redirects with sourceforge and still works with
some web servers which require the User Agent to be set.
def download_file(src_url, dest_dir):
try:
hdr = {
def download_file(src_url, dest_dir):
try:
hdr = {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20130405 Firefox/22.0',
+ 'User-Agent': 'Wget/1.13.4 (linux-gnu)',
}
request = urllib2.Request(src_url, headers=hdr)
response = urllib2.urlopen(request)
}
request = urllib2.Request(src_url, headers=hdr)
response = urllib2.urlopen(request)