From 0537dc926beeb12e45b877b35d0e1f87a02becb2 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 5 Oct 2017 16:50:02 +0200 Subject: [PATCH] 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. --- winfreed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.1.4