From 57ec3b44360bba7c82e939fa3808b619a3b69b15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Wed, 26 Jan 2011 14:11:49 +0200 Subject: [PATCH] fix broken 'link' extraction --- feedservice/feeddownloader.py | 3 +-- feedservice/youtube.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/feedservice/feeddownloader.py b/feedservice/feeddownloader.py index 15b184a..02d6a84 100644 --- a/feedservice/feeddownloader.py +++ b/feedservice/feeddownloader.py @@ -55,7 +55,6 @@ def parse_feed(feed_url, inline_logo, scale_to, strip_html, modified): return None, None, None, None feed = feedparser.parse(feed_content) - feed.feed.link = feed_url podcast = dict() @@ -105,7 +104,7 @@ def get_podcast_logo(feed): if cover_art: break - yturl = youtube.get_real_cover(feed.feed.link) + yturl = youtube.get_real_cover(feed.feed.get('link', None)) if yturl: cover_art = yturl diff --git a/feedservice/youtube.py b/feedservice/youtube.py index 6fd25e3..36b5b6b 100644 --- a/feedservice/youtube.py +++ b/feedservice/youtube.py @@ -38,6 +38,9 @@ def get_youtube_id(url): def get_real_cover(url): + if not url: + return None + rs = [re.compile('http://www\\.youtube\\.com/rss/user/([^/]+)/videos\\.rss', re.IGNORECASE), re.compile('http://www\\.youtube\\.com/profile_videos\\?user=([^\&]+)', re.IGNORECASE)] -- 2.11.4.GIT