mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
report Mozilla-compatible User-Agent
This commit is contained in:
parent
11696f949e
commit
14af7bc5a2
1 changed files with 2 additions and 1 deletions
|
@ -687,7 +687,8 @@ An error was ecountered while opening %s
|
|||
return
|
||||
|
||||
def _retrieveURL(self, url, ext):
|
||||
filecontents = urllib2.urlopen(url).read()
|
||||
req = urllib2.Request(url, None, {'User-Agent': 'Mozilla/5.0 (compatible; Anki/%s)' % ankiqt.appVersion })
|
||||
filecontents = urllib2.urlopen(req).read()
|
||||
(fd, name) = tempfile.mkstemp(prefix="anki", suffix=".%s" % ext.encode("ascii"))
|
||||
file = os.fdopen(fd, "wb")
|
||||
file.write(filecontents)
|
||||
|
|
Loading…
Reference in a new issue