Add Deno integration check and system info thread
Introduce check_ytdlp_deno_integration() in ytsage_yt_dlp.py to detect Deno integration by running `yt-dlp --verbose` and scanning debug output for JS runtimes containing "deno" (with timeout and logging/fallback). Add SystemInfoThread (QThread) in ytsage_dialogs_base.py to collect yt-dlp, ffmpeg and deno presence, versions, paths, cache timestamps and integration status in the background, emitting the gathered info via info_ready. AboutDialog now starts the thread in update_system_info() and populates the UI asynchronously via _populate_system_info(), showing a small "+ yt-dlp" integration indicator next to the Deno status when detected. Refactors usage of version/cache lookups to use the thread-provided info dictionary.
This commit is contained in:
@@ -712,3 +712,43 @@ def setup_ytdlp(parent_widget=None):
|
||||
# User cancelled or setup failed, return the fallback command
|
||||
logger.debug("Returning fallback command 'yt-dlp'")
|
||||
return "yt-dlp"
|
||||
|
||||
|
||||
def check_ytdlp_deno_integration() -> bool:
|
||||
"""
|
||||
Check if yt-dlp is integrated with Deno by running 'yt-dlp --verbose'.
|
||||
Returns:
|
||||
bool: True if Deno is detected in JS runtimes, False otherwise
|
||||
"""
|
||||
try:
|
||||
ytdlp_path = get_yt_dlp_path()
|
||||
if not ytdlp_path or ytdlp_path == "yt-dlp":
|
||||
return False
|
||||
|
||||
# Run yt-dlp --verbose to check JS runtimes
|
||||
# We use a dummy URL or just --verbose with no URL (which might error but should print debug info)
|
||||
# However, yt-dlp might not print debug info if no URL is provided and it errors out immediately with "usage".
|
||||
# But per user example: "yt-dlp.exe: error: You must provide at least one URL." comes AFTER debug info.
|
||||
|
||||
result = subprocess.run(
|
||||
[str(ytdlp_path), "--verbose"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=10,
|
||||
creationflags=SUBPROCESS_CREATIONFLAGS
|
||||
)
|
||||
|
||||
# Check stderr for "[debug] JS runtimes: deno"
|
||||
output = result.stderr
|
||||
if "[debug] JS runtimes:" in output and "deno" in output:
|
||||
# Find the line
|
||||
for line in output.splitlines():
|
||||
if "[debug] JS runtimes:" in line and "deno" in line:
|
||||
logger.info(f"Deno integration detected: {line.strip()}")
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to check yt-dlp Deno integration: {e}")
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user