Skip to content

Commit

Permalink
Backport YouTube playlist handling from 3.x (bug 1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Kölker authored and thp committed Feb 9, 2012
1 parent 1c13f4f commit f0953de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gpodder/util.py
Expand Up @@ -144,6 +144,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():
Expand Down
4 changes: 4 additions & 0 deletions src/gpodder/youtube.py
Expand Up @@ -127,6 +127,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):
Expand Down

0 comments on commit f0953de

Please sign in to comment.