aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-03-23 14:00:51 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-03-23 14:03:07 +0530
commite1feb88fdf09203e64a9f4cf7a761c228a21d720 (patch)
tree14d2b3114e423628518314042f04b91211fa825c
parent389b9dbbcc821e6f80bf1abf16e166d05ff46201 (diff)
downloadhypervideo-pre-e1feb88fdf09203e64a9f4cf7a761c228a21d720.tar.lz
hypervideo-pre-e1feb88fdf09203e64a9f4cf7a761c228a21d720.tar.xz
hypervideo-pre-e1feb88fdf09203e64a9f4cf7a761c228a21d720.zip
[niconico] Fix for when logged in
Related: https://github.com/yt-dlp/yt-dlp/issues/171#issuecomment-803692716 Co-authored by: CXwudi, xtkoba
-rw-r--r--yt_dlp/extractor/niconico.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/yt_dlp/extractor/niconico.py b/yt_dlp/extractor/niconico.py
index 337fdcdbd..e7aee65c3 100644
--- a/yt_dlp/extractor/niconico.py
+++ b/yt_dlp/extractor/niconico.py
@@ -492,13 +492,12 @@ class NiconicoIE(InfoExtractor):
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>',