]> jfr.im git - yt-dlp.git/commitdiff
[niconico] Fix for when logged in
authorpukkandan <redacted>
Tue, 23 Mar 2021 08:30:51 +0000 (14:00 +0530)
committerpukkandan <redacted>
Tue, 23 Mar 2021 08:33:07 +0000 (14:03 +0530)
Related: https://github.com/yt-dlp/yt-dlp/issues/171#issuecomment-803692716
Co-authored by: CXwudi, xtkoba

yt_dlp/extractor/niconico.py

index 337fdcdbdf4f5c434ff04522cf4a4478c169c1f0..e7aee65c309ad1462d71d0ed3b89d5312b799943 100644 (file)
@@ -492,13 +492,12 @@ def get_video_info_xml(items):
         self._sort_formats(formats)
 
         # Start extracting information
-        title = get_video_info_web('originalTitle')
-        if not title:
-            title = self._og_search_title(webpage, default=None)
-        if not title:
-            title = self._html_search_regex(
+        title = (
+            get_video_info_web(['originalTitle', 'title'])
+            or self._og_search_title(webpage, default=None)
+            or self._html_search_regex(
                 r'<span[^>]+class="videoHeaderTitle"[^>]*>([^<]+)</span>',
-                webpage, 'video title')
+                webpage, 'video title'))
 
         watch_api_data_string = self._html_search_regex(
             r'<div[^>]+id="watchAPIDataContainer"[^>]+>([^<]+)</div>',