Fix rss-redirection code
And add log, which was lost when splitting functions (which made this fix needed)master
parent
3b3ac4c8a6
commit
8209f243bb
|
@ -552,7 +552,8 @@ def Fetch(url, cache, options):
|
||||||
match = lxml.html.fromstring(xml).xpath("//link[@rel='alternate'][@type='application/rss+xml' or @type='application/atom+xml']/@href")
|
match = lxml.html.fromstring(xml).xpath("//link[@rel='alternate'][@type='application/rss+xml' or @type='application/atom+xml']/@href")
|
||||||
if len(match):
|
if len(match):
|
||||||
link = urlparse.urljoin(url, match[0])
|
link = urlparse.urljoin(url, match[0])
|
||||||
return Fetch(link, cachePath, options)
|
log('rss redirect: %s' % link)
|
||||||
|
return Fetch(link, cache.new(link), options)
|
||||||
else:
|
else:
|
||||||
log('no-link html')
|
log('no-link html')
|
||||||
raise MorssException('Link provided is an HTML page, which doesn\'t link to a feed')
|
raise MorssException('Link provided is an HTML page, which doesn\'t link to a feed')
|
||||||
|
|
Loading…
Reference in New Issue