#381·defuddle

YouTube: include already-loaded comments and replies with includeReplies

Author: serhii-zhydel-devCreated Sep 13, 2026Updated Sep 13, 2026

Request

Please support already-rendered YouTube comments and expanded replies when includeReplies: true is enabled. This would make YouTube page extraction useful for analyzing viewer feedback, in addition to the video description and transcript.

This request is limited to comments already present in the loaded document. It does not require automatically scrolling, expanding replies, or fetching all comments.

Observed behavior

Tested with unpatched Defuddle 0.19.3 in a Chrome extension, using synchronous extraction of a copy of the loaded page document.

Example: https://www.youtube.com/watch?v=jNQXAC9IVRw

  1. Open the video and scroll to the comments section.
  2. Wait for comments to render. In our repeated check, 16 non-empty visible ytd-comment-thread-renderer #content-text elements were present.
  3. Extract the page with includeReplies: true.
  4. Compare each loaded comment's text with the resulting Markdown.

Actual: 0 of the 16 loaded comments appeared in the output. The extension's output was 451 characters including its own title/source metadata, and contained video metadata/description but no comments. The result was not truncated. An earlier run with 2 loaded comments also retained neither comment.

Expected: include the loaded comment bodies, with author names and reply nesting where available. includeReplies: false should continue to exclude them.

The exact comment count and video description may change over time; the important distinction is that comments were already rendered before extraction, rather than missing because they had not loaded yet.

Configuration

typescript
import Defuddle from 'defuddle/full';

const result = new Defuddle(pageDocumentCopy, {
  url: pageUrl,
  markdown: true,
  useAsync: false,
  includeReplies: true,
  removeLowScoring: false,
  removePartialSelectors: false,
  removeContentPatterns: false,
  standardize: false,
  removeExactSelectors: true,
  removeHiddenElements: true,
}).parse();

Here pageDocumentCopy is an inert copy of the already-loaded browser document, not HTML obtained through a separate HTTP request.

Implementation observation

In the installed 0.19.3 YouTube extractor, buildResult() builds the video embed and description, then appends the transcript when available. It does not collect comment elements or consult includeReplies. This appears to be missing functionality rather than a lazy-loading or output-size issue.

It would be useful to reuse the shared comment formatting used by other extractors, preserving author, body, and parent/reply relationships. Suggested regression cases: loaded top-level comments, expanded replies, includeReplies: false, and a page without loaded comments. Existing video description/transcript extraction should remain intact.