Support for YouTube playlists

This commit is contained in:
Thomas Perl 2011-08-05 23:58:55 +02:00
parent 6db787e8b5
commit 2ceba6d99f
2 changed files with 7 additions and 0 deletions

View File

@ -161,6 +161,9 @@ def normalize_feed_url(url):
'yt:': 'http://www.youtube.com/rss/user/%s/videos.rss',
'sc:': 'http://soundcloud.com/%s',
'fm4od:': 'http://onapp1.orf.at/webcam/fm4/fod/%s.xspf',
# YouTube playlists. To get a list of playlists per-user, use:
# https://gdata.youtube.com/feeds/api/users/<username>/playlists
'ytpl:': 'http://gdata.youtube.com/feeds/api/playlists/%s',
}
for prefix, expansion in PREFIXES.iteritems():

View File

@ -137,6 +137,10 @@ def get_youtube_id(url):
if r is not None:
return r.group(1)
r = re.compile('http://(?:[a-z]+\.)?youtube\.com/v/(.*)[?]', re.IGNORECASE).match(url)
if r is not None:
return r.group(1)
return None
def is_video_link(url):