Commit 5a327081 authored by Kiste's avatar Kiste
Browse files

Fix missing ids

parent 378525f2
......@@ -39,8 +39,11 @@ def do_feed(url, rules_path, verbose):
try:
fg.id(feed['feed']['id'])
except KeyError:
print('Error in feed')
exit(1)
try:
fg.id(feed['feed']['link'])
except KeyError:
print('Error in feed ' + url + ':\nNo feed id or link')
exit(1)
fg.title(feed['feed']['title'])
fg.link(feed['feed']['links'])
try:
......@@ -69,7 +72,15 @@ def do_feed(url, rules_path, verbose):
fe.author(entry['author_detail'])
except KeyError:
pass
fe.id(entry['id'])
try:
fe.id(entry['id'])
except:
try:
for link in entry['links']:
fe.id(link['href'])
except KeyError:
print('Error in entry:\n\n' + fe)
exit(1)
fe.published(entry['published'])
fe.title(entry['title'])
fe.updated(entry['updated'])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment