info['uploader'] = self._html_search_meta(
'author', webpage, 'uploader', default=None)
- comments = None
- if self._downloader.params.get('getcomments', False):
- comments = self._get_all_comment_pages(video_id)
-
raw_danmaku = self._get_raw_danmaku(video_id, cid)
raw_tags = self._get_tags(video_id)
top_level_info = {
'raw_danmaku': raw_danmaku,
- 'comments': comments,
- 'comment_count': len(comments) if comments is not None else None,
'tags': tags,
'raw_tags': raw_tags,
}
+ if self._downloader.params.get('getcomments', False):
+ def get_comments():
+ comments = self._get_all_comment_pages(video_id)
+ return {
+ 'comments': comments,
+ 'comment_count': len(comments)
+ }
+
+ top_level_info['__post_extractor'] = get_comments
'''
# Requires https://github.com/m13253/danmaku2ass which is licenced under GPL3