diff options
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/feedgetter.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py index c0d93c50..d3195fb0 100644 --- a/pyaggr3g470r/feedgetter.py +++ b/pyaggr3g470r/feedgetter.py @@ -95,9 +95,12 @@ class FeedGetter(object): articles = [] for article in a_feed['entries']: - r = requests.get(article.link) - parsed_url = urlparse(r.url) - real_url = parsed_url.scheme + '://' + parsed_url.netloc + parsed_url.path + try: + r = requests.get(article.link) + parsed_url = urlparse(r.url) + real_url = parsed_url.scheme + '://' + parsed_url.netloc + parsed_url.path + except: + real_url = article.link if models.Article.objects(link=real_url).first() != None: # if article already in the database continue with the next article |