def _real_extract(self, url):
_src_url = r"""(http://hw-videos.*(?:mp4|flv))"""
- webpage_src = compat_urllib_request.urlopen(str(url)).read()
+ webpage_src = compat_urllib_request.urlopen(url).read()
webpage_src = webpage_src.decode('utf-8')
mobj = re.search(_src_url, webpage_src)
+ m = re.match(self._VALID_URL, url)
+ video_id = m.group('id')
+
if mobj is not None:
video_url = mobj.group()
if 'mp4' in video_url:
else:
ext = 'flv'
else:
- video_url = None
- ext = None
+ self._downloader.trouble(u'ERROR: Cannot find video url for %s' % video_id)
+ return
_title = r"""<title>(.*)</title>"""
if mobj is not None:
title = mobj.group(1)
thumbnail = None
-
- m = re.match(self._VALID_URL, url)
- video_id = m.group('id')
results = [{
'id': video_id,