Skip to content

[BUG] Bilibili analysis hangs indefinitely on "Updating format list" (Windows subprocess pipe deadlock) #138

Description

@KK-Hung

Description
When clicking Analyze on a Bilibili video URL, YTSage gets stuck permanently on the "Updating format list" status. It never times out, never throws an error, and never displays the format table. Analyzing YouTube URLs under the same environment works perfectly.
Steps to Reproduce
Open YTSage, confirm Generic Mode is enabled
Paste any Bilibili video link, e.g. https://www.bilibili.com/video/BV1dnuW6EEWz
Click the Analyze button
Observe the status bar shows "Updating format list" and waits indefinitely
Expected Behavior
Like YouTube links, analysis should complete within seconds and then display video info, format list, and subtitle options.
Actual Behavior
The status bar stays on "Updating format list" forever. Clicking Analyze multiple times spawns multiple --dump-single-json subprocesses, but earlier ones never return any result or error.
Environment
OS: Windows 10 (Build 26200)
YTSage version: Latest (built-in yt-dlp updated to nightly@2026.08.04.234419)
yt-dlp path: C:\Users\kk_hu\AppData\Local\YTSage\bin\yt-dlp.exe
Deno path: C:\Users\kk_hu\AppData\Local\YTSage\bin\deno.exe
Network: Direct connection to Bilibili, no proxy
Key Log Comparison
YouTube analysis (normal, full callback):
plain
08:36:13.976 Executing yt-dlp command: ['--dump-single-json', '--flat-playlist', '--no-warnings', 'https://www.youtube.com/watch?v=qNsq7k8qJPQ']
08:37:03.173 SponsorBlock categories selected: []
08:37:16.867 Selected subtitles: ['en-US - Manual']
...subsequent format list and download flow appear normally
Bilibili analysis (abnormal, subprocess never returns):
plain
08:38:41.539 Executing yt-dlp command: ['--dump-single-json', '--flat-playlist', '--no-warnings', 'https://www.bilibili.com/video/BV1dnuW6EEWz']
08:38:50.823 Executing yt-dlp command: ['--dump-single-json', '--flat-playlist', '--no-warnings', 'https://www.bilibili.com/video/BV1dnuW6EEWz/?spm_id_from=...']
...after this, the log only shows repeated check_ytdlp_binary and check_deno_binary calls; no analysis success or failure callback ever appears
What I Have Ruled Out
yt-dlp itself is fine: running -F --simulate in YTSage's Custom Commands correctly prints the Bilibili format list
Running yt-dlp --dump-single-json directly in a terminal also returns valid JSON
Not a Cookie issue: cleared logs, disabled cookies, problem persists
Not a yt-dlp version issue: tested both stable and nightly channels, same behavior
Not a Generic Mode issue: confirmed enabled
Initial Analysis
I suspect a subprocess pipe deadlock in ytsage_gui_analysis.py's _analyze_url_with_subprocess on Windows. Bilibili's --dump-single-json output is typically much larger than YouTube's (includes anthology info, chapters, danmaku metadata, etc.), which may fill the default subprocess.PIPE buffer. This causes yt-dlp to block on the write side while YTSage blocks on the read side, resulting in a silent deadlock with no exception thrown.
Attachments
ytsage.log (clean log with cookies disabled)
ytsage_error.log (empty, no errors logged)

ytsage.log
ytsage_error.log

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions