]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[ustream] Add an alternative approach to extract title (fixes #5128)
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 23 Apr 2015 10:24:44 +0000 (18:24 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 23 Apr 2015 10:24:44 +0000 (18:24 +0800)
youtube_dl/extractor/ustream.py

index f8893b6cdc1dd7adbf7143bfdf6d5e7f604f3e98..a395dc5dac85d0dabe5aea59e25275942f7e28a8 100644 (file)
@@ -58,7 +58,16 @@ class UstreamIE(InfoExtractor):
         self.report_extraction(video_id)
 
         video_title = self._html_search_regex(r'data-title="(?P<title>.+)"',
-                                              webpage, 'title')
+                                              webpage, 'title', default=None)
+
+        if not video_title:
+            try:
+                video_title = params['moduleConfig']['meta']['title']
+            except KeyError:
+                pass
+
+        if not video_title:
+            video_title = 'Ustream video ' + video_id
 
         uploader = self._html_search_regex(r'data-content-type="channel".*?>(?P<uploader>.*?)</a>',
                                            webpage, 'uploader', fatal=False, flags=re.DOTALL)