Fix rss-redirection code

And add log, which was lost when splitting functions (which made this fix needed)
master
pictuga 2014-01-11 18:15:36 +01:00
parent 3b3ac4c8a6
commit 8209f243bb
1 changed files with 2 additions and 1 deletions

View File

@ -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')