]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/niconico.py
[cleanup] Misc fixes
[yt-dlp.git] / yt_dlp / extractor / niconico.py
index a5a1a01e09a17f3c64a6ce2e0000319d7a2987e1..4eb6ed070ad493f939c2dceb9cbf0dfa7586fa71 100644 (file)
@@ -469,7 +469,7 @@ def _get_subtitles(self, video_id, api_data, session_api_data):
         comment_user_key = traverse_obj(api_data, ('comment', 'keys', 'userKey'))
         user_id_str = session_api_data.get('serviceUserId')
 
-        thread_ids = [x for x in traverse_obj(api_data, ('comment', 'threads')) or [] if x['isActive']]
+        thread_ids = traverse_obj(api_data, ('comment', 'threads', lambda _, v: v['isActive']))
         raw_danmaku = self._extract_all_comments(video_id, thread_ids, user_id_str, comment_user_key)
         if not raw_danmaku:
             self.report_warning(f'Failed to get comments. {bug_reports_message()}')