diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-20 03:25:12 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-20 03:25:12 +0800 |
commit | e0690782b8531f9962950693fe33a5d4a4f494f6 (patch) | |
tree | 048d7ef198f785c20a8ba0df9710b61268790fc9 /youtube_dl | |
parent | 8fff4f61e5741e56890ccb108f42b0c7dc6607e8 (diff) |
[letv] LetvCloud: guard against invalid URLs
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/letv.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dl/extractor/letv.py b/youtube_dl/extractor/letv.py index be6c75967..b8d4f5bb8 100644 --- a/youtube_dl/extractor/letv.py +++ b/youtube_dl/extractor/letv.py @@ -272,8 +272,14 @@ class LetvCloudIE(InfoExtractor): }] def _real_extract(self, url): - uu = re.search('uu=([\w]+)', url).group(1) - vu = re.search('vu=([\w]+)', url).group(1) + uu_mobj = re.search('uu=([\w]+)', url) + vu_mobj = re.search('vu=([\w]+)', url) + + if not uu_mobj or not vu_mobj: + raise ExtractorError('Invalid URL: %s' % url, expected=True) + + uu = uu_mobj.group(1) + vu = vu_mobj.group(1) media_id = uu + '_' + vu play_json_req = sanitized_Request( |