fix: close remaining concurrent yt-dlp session sources

Three more code paths were bypassing the _meta_lock guard and firing
raw yt-dlp processes concurrently with active downloads:

- Popular fetch Phase 1 (flat-playlist channel crawl): changed from
  ytdlp._run to ytdlp._meta_run so it waits for active downloads
- download_subs_only: changed from _run to _meta_run
- fetch_video_comments: returns empty list immediately if a download
  is active (avoids blocking a 90s call indefinitely)
- Diagnostic test endpoint (settings): switched to _meta_run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 03:12:12 +02:00
parent c223e57463
commit 0c5b236b77
3 changed files with 13 additions and 8 deletions

View File

@@ -250,7 +250,7 @@ def ytdlp_test(
except Exception:
pass
result = subprocess.run(
test_stdout, test_stderr, test_code = ytdlp._meta_run(
[
"yt-dlp",
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
@@ -258,15 +258,15 @@ def ytdlp_test(
"--extractor-args", "youtube:player_client=web",
*cookie_args,
],
capture_output=True, text=True, timeout=30,
timeout=30,
)
return {
"node_path": node_path,
"node_version": node_version,
"yt_dlp_version": yt_version,
"cookie_args": cookie_args,
"returncode": result.returncode,
"stdout_lines": result.stdout.splitlines()[:5],
"stderr_tail": result.stderr.splitlines()[-20:],
"success": result.returncode == 0,
"returncode": test_code,
"stdout_lines": test_stdout.splitlines()[:5],
"stderr_tail": test_stderr.splitlines()[-20:],
"success": test_code == 0,
}