fix(youtube): fall back to HTML when no video content is extracted - #2469
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Whitespace-only metadata still suppresses HTML fallback and can discard useful body content.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds HTML fallback when YouTube-specific extraction yields no content.
Changes:
- Defers the YouTube heading until content exists.
- Rewinds streams and delegates empty results to
HtmlConverter. - Adds fallback and regression tests.
File summaries
| File | Description |
|---|---|
_youtube_converter.py |
Implements HTML fallback. |
test_youtube_converter.py |
Tests fallback and preserved output. |
test_module_misc.py |
Updates titleless-page expectations. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The fallback is correctly implemented and covered across metadata, transcript, charset, stream-position, and dispatcher scenarios.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing the YouTube converter’s title assertion allowed titleless pages to return only # YouTube when no video metadata, description, or transcript was extracted. This reported a successful conversion and prevented the generic HTML fallback from preserving useful body content.
This change adds the YouTube heading only after actual content has been extracted. If extraction produces nothing, the converter rewinds the stream to its original position and delegates to HtmlConverter , preserving the charset and conversion options.
Successful YouTube output remains unchanged, including titleless pages with useful descriptions or library-provided transcripts. Transcript retrieval and its existing error handling are unchanged.