diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-08-30 08:34:21 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-08-30 08:34:21 +0200 |
commit | 759678db1004bbbc24136e96a6a450c7161181ac (patch) | |
tree | 7d472302765ecce5ce45500fb9e77102abced7bd /source | |
parent | Added some comments. (diff) | |
download | newspipe-759678db1004bbbc24136e96a6a450c7161181ac.tar.gz newspipe-759678db1004bbbc24136e96a6a450c7161181ac.tar.bz2 newspipe-759678db1004bbbc24136e96a6a450c7161181ac.zip |
Improvement: the user-agent is now set when looking for a feed (rss or atom) in a Web page.
Diffstat (limited to 'source')
-rwxr-xr-x | source/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/utils.py b/source/utils.py index 1cb1af6f..aaaa558c 100755 --- a/source/utils.py +++ b/source/utils.py @@ -284,7 +284,8 @@ def search_feed(url): """ soup = None try: - page = urllib.request.urlopen(url) + req = urllib.request.Request(url, headers={'User-Agent' : conf.USER_AGENT}) + page = urllib.request.urlopen(req) soup = BeautifulSoup(page) except: return None |