]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[metacafe] Use modern helper methods
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 16 Jul 2013 23:35:33 +0000 (01:35 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 16 Jul 2013 23:35:33 +0000 (01:35 +0200)
youtube_dl/extractor/metacafe.py

index 844a24efb56412e8b748386c0fa15663c4f7a5dd..94d9ef62f44ece41df5a927f22f7c8b6b4448309 100644 (file)
@@ -118,11 +118,7 @@ class MetacafeIE(InfoExtractor):
                 video_url = '%s?__gda__=%s' % (mediaURL, mobj.group('key'))
                 video_ext = determine_ext(video_url)
 
-        mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage)
-        if mobj is None:
-            raise ExtractorError(u'Unable to extract title')
-        video_title = mobj.group(1).decode('utf-8')
-
+        video_title = self._html_search_regex(r'(?im)<title>(.*) - Video</title>', webpage, u'title')
         video_uploader = self._html_search_regex(r'submitter=(.*?);|<p class="By">\s*By\s*<a[^>]*>(.*?)</a>', webpage, u'uploader nickname', fatal=False)
 
         return [{