This commit is contained in:
Johny Mo Swag 2013-03-07 15:39:17 -08:00
parent 61e40c88a9
commit b3bcca0844

View File

@ -3659,20 +3659,19 @@ class WorldStarHipHopIE(InfoExtractor):
IE_NAME = u'WorldStarHipHop' IE_NAME = u'WorldStarHipHop'
def _real_extract(self, url): def _real_extract(self, url):
results = []
_src_url = r"""(http://hw-videos.*(?:mp4|flv))""" _src_url = r"""(http://hw-videos.*(?:mp4|flv))"""
webpage_src = compat_urllib_request.urlopen(str(url)).read() webpage_src = compat_urllib_request.urlopen(str(url)).read()
webpage_src = webpage_src.decode('utf-8')
mobj = re.search(_src_url, webpage_src) mobj = re.search(_src_url, webpage_src)
if mobj is not None: if mobj is not None:
video_url = mobj.group() video_url = mobj.group()
if 'mp4' in video_url: if 'mp4' in video_url:
ext = '.mp4' ext = 'mp4'
else: else:
ext = '.flv' ext = 'flv'
else: else:
video_url = None video_url = None
ext = None ext = None
@ -3683,16 +3682,12 @@ def _real_extract(self, url):
if mobj is not None: if mobj is not None:
title = mobj.group(1) title = mobj.group(1)
title = title.replace("'", "")
title = title.replace("'", "")
title = title.replace('Video: ', '')
title = title.replace('"', '"')
title = title.replace('&', 'n')
else: else:
title = None title = 'World Start Hip Hop - %s' % time.ctime()
_thumbnail = r"""rel="image_src" href="(.*)" />""" _thumbnail = r"""rel="image_src" href="(.*)" />"""
print title
mobj = re.search(_thumbnail, webpage_src) mobj = re.search(_thumbnail, webpage_src)
# Getting thumbnail and if not thumbnail sets correct title for WSHH candy video. # Getting thumbnail and if not thumbnail sets correct title for WSHH candy video.
@ -3705,13 +3700,12 @@ def _real_extract(self, url):
title = mobj.group(1) title = mobj.group(1)
thumbnail = None thumbnail = None
results.append({ results = [{
'url' : video_url, 'url' : video_url,
'title' : title, 'title' : title,
'thumbnail' : thumbnail, 'thumbnail' : thumbnail,
'ext' : ext 'ext' : ext,
}) }]
return results return results
class RBMARadioIE(InfoExtractor): class RBMARadioIE(InfoExtractor):