Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix feedparser invocation in remote

In particular, the code to grab the name of a feed automatically.

Signed-off-by: Jack Miller <jack@codezen.org>
  • Loading branch information...
commit c4f88d79f023cf34da72c1f193cfe1e8f5f6d671 1 parent 71243c9
@themoken authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 canto_next/remote.py
View
7 canto_next/remote.py
@@ -115,11 +115,10 @@ def _wait_response(self, cmd):
return None
def _autoname(self, URL):
- request = urllib.request.Request(URL)
- request.add_header('User-Agent',\
- 'Canto-Remote/0.8.0 + http://codezen.org/canto')
+ extra_headers = { 'User-Agent' :\
+ 'Canto/0.8.0 + http://codezen.org/canto' }
try:
- content = feedparser.parse(feedparser.urllib2.urlopen(request))
+ content = feedparser.parse(URL, request_headers = extra_headers)
except Exception as e:
print_wrap("ERROR: Couldn't determine name: %s" % e)
return None
Please sign in to comment.
Something went wrong with that request. Please try again.