Support more YouTube URLs

The regular expression is also more strict, yet accepts the
youtu.be short URLs and user page URLs.
This commit is contained in:
Laurent Bachelier 2011-05-01 14:37:15 +02:00
commit 5e90c1f47c
3 changed files with 7 additions and 1 deletions

View file

@ -28,3 +28,8 @@ class YoutubeVideo(BaseVideo):
@classmethod
def id2url(cls, _id):
return 'http://www.youtube.com/watch?v=%s' % _id
def _get_shorturl(self):
return 'http://youtu.be/%s' % self.id
shorturl = property(_get_shorturl)