mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
News downloads: When getting an article URL from a RSS feed, look first for an original article link. This speeds up the download of news services that use a syndication service like feedburner or pheedo to publish their RSS feeds.
This commit is contained in:
parent
69c10e202c
commit
3e69d4c2aa
@ -357,9 +357,17 @@ class BasicNewsRecipe(Recipe):
|
||||
Override in a subclass to customize extraction of the :term:`URL` that points
|
||||
to the content for each article. Return the
|
||||
article URL. It is called with `article`, an object representing a parsed article
|
||||
from a feed. See `feedsparser <http://www.feedparser.org/docs/>`_.
|
||||
By default it returns `article.link <http://www.feedparser.org/docs/reference-entry-link.html>`_.
|
||||
from a feed. See `feedparser <http://www.feedparser.org/docs/>`_.
|
||||
By default it looks for the original link (for feeds syndicated via a
|
||||
service like feedburner or pheedo) and if found,
|
||||
returns that or else returns
|
||||
`article.link <http://www.feedparser.org/docs/reference-entry-link.html>`_.
|
||||
'''
|
||||
for key in article.keys():
|
||||
if key.endswith('_origlink'):
|
||||
url = article[key]
|
||||
if url and url.startswith('http://'):
|
||||
return url
|
||||
return article.get('link', None)
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
|
Loading…
x
Reference in New Issue
Block a user