mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Error handling when no videos in feed.
This commit is contained in:
parent
b9d876c4c9
commit
fcaae3a162
1 changed files with 11 additions and 10 deletions
|
@ -49,16 +49,17 @@ class FacebookFetcher:
|
|||
merged_data.append(story_data)
|
||||
|
||||
videos = feed.get('videos', {}).get('data', None)
|
||||
for video in videos:
|
||||
story_data = self.page_video_story(facebook_user, video)
|
||||
if not story_data:
|
||||
continue
|
||||
for seen_data in merged_data:
|
||||
if story_data['link'] == seen_data['link']:
|
||||
# Video wins over posts (and attachments)
|
||||
seen_data['description'] = story_data['description']
|
||||
seen_data['title'] = story_data['title']
|
||||
break
|
||||
if videos:
|
||||
for video in videos:
|
||||
story_data = self.page_video_story(facebook_user, video)
|
||||
if not story_data:
|
||||
continue
|
||||
for seen_data in merged_data:
|
||||
if story_data['link'] == seen_data['link']:
|
||||
# Video wins over posts (and attachments)
|
||||
seen_data['description'] = story_data['description']
|
||||
seen_data['title'] = story_data['title']
|
||||
break
|
||||
|
||||
for story_data in merged_data:
|
||||
rss.add_item(**story_data)
|
||||
|
|
Loading…
Add table
Reference in a new issue