aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-08-30 08:34:21 +0200
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-08-30 08:34:21 +0200
commit759678db1004bbbc24136e96a6a450c7161181ac (patch)
tree7d472302765ecce5ce45500fb9e77102abced7bd /source
parentAdded some comments. (diff)
downloadnewspipe-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-xsource/utils.py3
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
bgstack15