Repository navigation
fix(local): pull a YouTube live link as its video - #2359
Conversation
A youtube.com/live/<id> link fit no video path, so it was opened as a list, which the YouTube plugin cannot read, and its group came back failed. It is now one source, and the plugin is sent the same video's watch?v= link, since its resolver does not read /live/.
|
@MohammadHijjawi97 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Live URL handling and verification surfsense_local/backend/modules/documents/web_sources/pullers/youtube.py, surfsense_local/backend/tests/unit/documents/web_sources/pullers/test_youtube.py, docs/architecture/web-sources.md |
The puller recognizes /live/<id> paths and rewrites matching URLs to watch-page URLs for its requests. Tests check classification and rewriting. The documentation lists /live/ as an accepted URL form and removes the related known-gap entry. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 5eb22
-
The change is ready to merge; no concrete correctness or availability risk is established.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
What
A
youtube.com/live/<id>link is now one source, like awatch?v=link. The YouTube puller sends the plugin the same video'swatch?v=<id>link, since the plugin's resolver does not read/live/. The stored source keeps the link as pasted.Why
docs/architecture/web-sources.mdlists it as a Known gap: a/live/<id>link fit none of the puller's video paths, so Add from the web opened it as a list, which the plugin cannot read, and its group came back failed. YouTube's Share button gives this link for live streams and for past streams.Before:
PULLER.fit(urlsplit("https://www.youtube.com/live/tide1?si=x"))isFit.LIST.After: it is
Fit.ONE, andPULLER.calls(...)sendshttps://www.youtube.com/watch?v=tide1toscrapeandcomments.The doc's puller table now lists
/live/, and the Known gap line is deleted. A channel's/@name/livelink still opens as a channel list, as before.How to test
The new
/live/case intest_a_video_is_one_sourceandtest_a_live_link_is_pulled_as_its_watch_pagefail ondevand pass with this change. All puller tests pass (95), ruff is clean, andpython scripts/check_docs.pypasses.High-level PR Summary
This PR fixes handling of YouTube live stream URLs (e.g.,
youtube.com/live/<id>) by converting them to standard watch URLs (watch?v=<id>) before sending to the plugin, since the plugin's resolver doesn't support the/live/path format. The stored source preserves the original pasted link while the puller now recognizes/live/URLs as single video sources instead of incorrectly treating them as lists.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_local/backend/modules/documents/web_sources/pullers/youtube.pysurfsense_local/backend/tests/unit/documents/web_sources/pullers/test_youtube.pydocs/architecture/web-sources.mdSummary by CodeRabbit
/live/links are now recognized and processed as individual videos, alongside other supported video URL formats.