Youku: match vid more precisely (underscores excluded)

This commit is contained in:
Mort Yao 2014-11-13 21:17:18 +01:00
parent 153d8649ca
commit a5a28c1d7a

View File

@ -55,14 +55,14 @@ class Youku(VideoExtractor):
def get_vid_from_url(url):
"""Extracts video ID from URL.
"""
return match1(url, r'youku\.com/v_show/id_([\w=]+)') or \
match1(url, r'player\.youku\.com/player\.php/sid/([\w=]+)/v\.swf') or \
match1(url, r'loader\.swf\?VideoIDS=([\w=]+)')
return match1(url, r'youku\.com/v_show/id_([a-zA-Z0-9=]+)') or \
match1(url, r'player\.youku\.com/player\.php/sid/([a-zA-Z0-9=]+)/v\.swf') or \
match1(url, r'loader\.swf\?VideoIDS=([a-zA-Z0-9=]+)')
def get_playlist_id_from_url(url):
"""Extracts playlist ID from URL.
"""
return match1(url, r'youku\.com/playlist_show/id_([\w=]+)')
return match1(url, r'youku\.com/playlist_show/id_([a-zA-Z0-9=]+)')
def download_playlist_by_url(self, url, **kwargs):
self.url = url