Add user-agent to newznab request
Fixes #2611
Note that urlib2.urlopen should just follow redirects so I dont
understand why we need 3b519aeac9
This commit is contained in:
@@ -163,6 +163,7 @@ class Newznab(NZBProvider, RSS):
|
|||||||
# Get final redirected url
|
# Get final redirected url
|
||||||
log.debug('Checking %s for redirects.', url)
|
log.debug('Checking %s for redirects.', url)
|
||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
|
req.add_header('User-Agent', self.user_agent)
|
||||||
res = urllib2.urlopen(req)
|
res = urllib2.urlopen(req)
|
||||||
finalurl = res.geturl()
|
finalurl = res.geturl()
|
||||||
if finalurl != url:
|
if finalurl != url:
|
||||||
|
|||||||
Reference in New Issue
Block a user