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:
parent
740e7f12d2
commit
5e90c1f47c
3 changed files with 7 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue