mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 05:02:01 -06:00
[GH-ISSUE #24856] issue: Pasting a youtu.be short URL returns 400 "content provided is empty" due to allow_redirects=False
#123725
Reference in New Issue
Block a user
Originally created by @AirRunner on GitHub (May 18, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24856
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.9.5
Ollama Version (if applicable)
No response
Operating System
macOS Tahoe 26.5
Browser (if applicable)
Safari 26.5
Confirmation
README.md.Expected Behavior
Pasting a
youtu.beshort URL into the chat should load the YouTube transcript viaYoutubeLoader, exactly as it does when using the fullhttps://www.youtube.com/watch?v=URL.Actual Behavior
The request returns HTTP 400 with:
The UI shows an infinite spinner. No transcript is loaded.
Using the equivalent full
youtube.com/watch?v=URL works correctly.Steps to Reproduce
pip install open-webuion Python 3.12.open-webui serve.#+ paste ayoutu.beshort URL directly into the chat inputhttps://www.youtube.com/watch?v=and paste again, it succeeds.Logs & Screenshots
Server log failure with
youtu.be:Browser network tab (Safari DevTools):
Server log success with
youtube.com/watch?v=:Additional Information
Root cause
In
open_webui/retrieval/utils.py,get_content_from_url()performs a HEAD-like probe to determine the content type before deciding whether to invokeYoutubeLoaderor a binary extractor:AIOHTTP_CLIENT_ALLOW_REDIRECTSdefaults toFalse. When the URL ishttps://youtu.be/..., YouTube responds with HTTP 303 andContent-Type: application/binary. Since redirects are not followed,_is_text_content_type('application/binary')returnsFalse, and the code falls through to the binary content handler, bypassingYoutubeLoaderentirely. The binary handler extracts no text, resulting in empty docs and the EMPTY_CONTENT error.With
https://www.youtube.com/watch?v=..., there is no redirect, the probe gets HTTP 200 withtext/html,_is_text_content_type()returnsTrue, andYoutubeLoaderis correctly invoked.Note:
is_youtube_url()already exists in the same file and matches bothyoutube.comandyoutu.be, so the URL is correctly identified as YouTube, but only inget_loader(), which is never reached foryoutu.beURLs due to the probe short-circuiting the flow.Proposed fix
One possible fix would be to bypass the content-type probe for URLs where
is_youtube_url()is true, sinceYoutubeLoaderusesyoutube-transcript-apidirectly and does not make the redirected HTTP request.@owui-terminator[bot] commented on GitHub (May 18, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #2110 Youtube RAG Shortcut URL Update
This issue is directly about the same gap: shortened YouTube URLs (
youtu.be) were not being recognized for RAG/paste handling, and the proposed fix was to includeyoutu.be. Your new issue is the backend-side manifestation of that same short-URL path failing.by thebetauser
🟣 #7077 issue: youtube error
This earlier bug report shows the same user-visible failure mode: YouTube extraction via
#<youtube url>returns the empty-content 400 error. Although it focused on full URLs and an older version, it is clearly the same retrieval pipeline and same error class.by hongbo-miao
🟣 #6208 issue: youtube video errors
This is another YouTube extraction failure in the same feature area (
process/youtube) with related logs and loader behavior. The underlying cause differs, but it is still useful context for repeated YouTube transcript/loading issues in Open WebUI.by zabirauf
🟣 #14752 issue: Youtube Link Embed Bug: '[ERROR: no element found: line 1, column 0]'
This issue is about YouTube link embedding in the chat input and demonstrates another frontend-facing failure around YouTube URL handling. It is related to the same user workflow of pasting a YouTube link, even though the exact error differs.
by lucyknada ·
bug💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@tjbck commented on GitHub (May 19, 2026):
Addressed in dev!