From a5a28c1d7ad3895f09d079a08cd895d196f3bbf5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 13 Nov 2014 21:17:18 +0100 Subject: [PATCH] Youku: match vid more precisely (underscores excluded) --- src/you_get/extractors/youku.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/you_get/extractors/youku.py b/src/you_get/extractors/youku.py index 09b06a61..c9d98bfd 100644 --- a/src/you_get/extractors/youku.py +++ b/src/you_get/extractors/youku.py @@ -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