[tmz] Simplify (#4304)
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 25 Nov 2014 08:16:40 +0000 (09:16 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 25 Nov 2014 08:16:40 +0000 (09:16 +0100)
youtube_dl/extractor/tmz.py

index b82dc8233f6201a0a94f550b9b4c91debb247701..827aa08a455e05cb6f8a17f7dd11d91b5ad3be35 100644 (file)
@@ -21,19 +21,12 @@ class TMZIE(InfoExtractor):
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
-
         webpage = self._download_webpage(url, video_id)
 
-        url = self._html_search_regex(r'<meta name="VideoURL" content="(.+)"', webpage, 'url')
-        title = self._html_search_regex(r'<meta property="og:title" content="(.+)"', webpage, 'title')
-        description = self._html_search_regex(r'<meta property="og:description" content="(.+)"', webpage, 'description')
-        thumbnail_url = self._html_search_regex(r'<meta name="ThumbURL" content="(.+)"', webpage, 'thumbnail url')
-
         return {
             'id': video_id,
-            'url': url,
-            'ext': 'mp4',
-            'title': title,
-            'description': description,
-            'thumbnail': thumbnail_url,
+            'url': self._html_search_meta('VideoURL', webpage, fatal=True),
+            'title': self._og_search_title(webpage),
+            'description': self._og_search_description(webpage),
+            'thumbnail': self._html_search_meta('ThumbURL', webpage),
         }