Skip to content

Commit 5137f42

Browse files
committed
Fix bug with podcast without link to a web page
See for example: https://feeds.megaphone.fm/sciencevs This feed has only links to audio files.
1 parent 8816b21 commit 5137f42

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: download_feeds.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -147,21 +147,22 @@ def get_news(entry, media_link=False):
147147
"""
148148

149149
media_type = 'text/html'
150-
entry_link = entry.link
151150

152151
if media_link:
153152
media_types = ['audio', 'video']
154153
else:
155154
media_types = ['text']
156155

157-
links = entry.get('links', entry.link)
156+
entry_link = entry.get('link', '')
157+
158+
links = entry.get('links', entry_link)
158159

159160
if hasattr(entry, 'published_parsed'):
160161
entry_published = str(calendar.timegm(entry.published_parsed))
161162
else:
162163
entry_published = 0
163164

164-
if links != entry.link:
165+
if links != entry_link:
165166
matching = [link for link in links if link.type.split(
166167
'/')[0] in media_types]
167168
if matching:

0 commit comments

Comments
 (0)