]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
YouTube: Fall back to <meta> description if video is rated (Fixes #800)
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 23 Apr 2013 11:54:17 +0000 (13:54 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 23 Apr 2013 11:54:17 +0000 (13:54 +0200)
youtube_dl/InfoExtractors.py

index 208b44887545ee1bba04e598787e6c574d5bd5cf..d5876ad3463b71a841b00552f0b97737b4264996 100755 (executable)
@@ -570,7 +570,11 @@ class YoutubeIE(InfoExtractor):
         if video_description:
             video_description = clean_html(video_description)
         else:
-            video_description = u''
+            fd_mobj = re.search(r'<meta name="description" content="([^"]+)"', video_webpage)
+            if fd_mobj:
+                video_description = unescapeHTML(fd_mobj.group(1))
+            else:
+                video_description = u''
 
         # subtitles
         video_subtitles = None