1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-28 08:36:49 +01:00

[letv] LetvCloud: guard against invalid URLs

This commit is contained in:
Yen Chi Hsuan 2016-01-20 03:25:12 +08:00
parent 8fff4f61e5
commit e0690782b8

View File

@ -272,8 +272,14 @@ class LetvCloudIE(InfoExtractor):
}] }]
def _real_extract(self, url): def _real_extract(self, url):
uu = re.search('uu=([\w]+)', url).group(1) uu_mobj = re.search('uu=([\w]+)', url)
vu = re.search('vu=([\w]+)', url).group(1) 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 media_id = uu + '_' + vu
play_json_req = sanitized_Request( play_json_req = sanitized_Request(