summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-05 14:20:15 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-05 14:20:15 +0200
commit2491f5898ecdb0828a4619a983239657b190c4fa (patch)
tree63e3cd681c80b8c289837ecfcc049e80eda2d0c3
parentb27c856fbc1d36537a6caaaffe18e07ccc2bf4cf (diff)
downloadyoutube-dl-2491f5898ecdb0828a4619a983239657b190c4fa.tar.gz
youtube-dl-2491f5898ecdb0828a4619a983239657b190c4fa.tar.xz
youtube-dl-2491f5898ecdb0828a4619a983239657b190c4fa.zip
DailymotionIE: simplify the extraction of the title and remove an unused assignment of video_uploader
-rw-r--r--youtube_dl/extractor/dailymotion.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index 0b47d652a..e15ea549a 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -6,7 +6,6 @@ from ..utils import (
     compat_urllib_request,
 
     ExtractorError,
-    unescapeHTML,
 )
 
 class DailymotionIE(InfoExtractor):
@@ -40,13 +39,9 @@ class DailymotionIE(InfoExtractor):
         # Extract URL, uploader and title from webpage
         self.report_extraction(video_id)
 
+        video_title = self._html_search_regex(r'<meta property="og:title" content="(.*?)" />',
+                                              webpage, 'title')
 
-        mobj = re.search(r'<meta property="og:title" content="(?P<title>[^"]*)" />', webpage)
-        if mobj is None:
-            raise ExtractorError(u'Unable to extract title')
-        video_title = unescapeHTML(mobj.group('title'))
-
-        video_uploader = None
         video_uploader = self._search_regex([r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a>',
                                              # Looking for official user
                                              r'<(?:span|a) .*?rel="author".*?>([^<]+?)</'],