From: Antonio Ospite Date: Thu, 5 Oct 2017 14:50:02 +0000 (+0200) Subject: winfreed.py: pretend to be wget X-Git-Url: https://git.ao2.it/winfreed.git/commitdiff_plain/0537dc926beeb12e45b877b35d0e1f87a02becb2 winfreed.py: pretend to be wget This avoids annoying redirects with sourceforge and still works with some web servers which require the User Agent to be set. --- diff --git a/winfreed.py b/winfreed.py index a2b95ab..d520b1e 100755 --- a/winfreed.py +++ b/winfreed.py @@ -70,7 +70,7 @@ def show(pkg): 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)