mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
News download: Add support for Atom feeds that have no link field, instead an alternate link in the links field
This commit is contained in:
parent
ef7220caf3
commit
66c90b8cb0
@ -463,7 +463,13 @@ class BasicNewsRecipe(Recipe):
|
||||
url = article[key]
|
||||
if url and url.startswith('http://'):
|
||||
return url
|
||||
return article.get('link', None)
|
||||
ans = article.get('link', None)
|
||||
if not ans and article.links:
|
||||
for item in article.links:
|
||||
if item.get('rel', 'alternate') == 'alternate':
|
||||
ans = item['href']
|
||||
break
|
||||
return ans
|
||||
|
||||
def skip_ad_pages(self, soup):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user