update screenshot
This commit is contained in:
+3
-13
@@ -191,23 +191,19 @@ class PlaywrightTool:
|
||||
if candidate and Path(candidate).exists():
|
||||
ffmpeg_path = candidate
|
||||
else:
|
||||
debug(f"Configured ffmpeg path does not exist: {candidate}")
|
||||
ffmpeg_path = None
|
||||
|
||||
if not ffmpeg_path:
|
||||
# Prefer a global FFMPEG_PATH env var (shared by tools) before Playwright-specific one
|
||||
env_ffmpeg = os.environ.get("FFMPEG_PATH")
|
||||
if env_ffmpeg and Path(env_ffmpeg).exists():
|
||||
ffmpeg_path = env_ffmpeg
|
||||
elif env_ffmpeg:
|
||||
debug(f"FFMPEG_PATH set but path does not exist: {env_ffmpeg}")
|
||||
|
||||
if not ffmpeg_path:
|
||||
# Backward-compatible Playwright-specific env var
|
||||
env_ffmpeg2 = os.environ.get("PLAYWRIGHT_FFMPEG_PATH")
|
||||
if env_ffmpeg2 and Path(env_ffmpeg2).exists():
|
||||
ffmpeg_path = env_ffmpeg2
|
||||
elif env_ffmpeg2:
|
||||
debug(f"PLAYWRIGHT_FFMPEG_PATH set but path does not exist: {env_ffmpeg2}")
|
||||
|
||||
if not ffmpeg_path:
|
||||
# Try to find bundled ffmpeg in the project (Windows-only, in MPV/ffmpeg/bin)
|
||||
@@ -218,20 +214,14 @@ class PlaywrightTool:
|
||||
ffmpeg_exe = bundled_ffmpeg / ("ffmpeg.exe" if os.name == "nt" else "ffmpeg")
|
||||
if ffmpeg_exe.exists():
|
||||
ffmpeg_path = str(ffmpeg_exe)
|
||||
debug(f"Found bundled ffmpeg at: {ffmpeg_path}")
|
||||
except Exception as e:
|
||||
debug(f"Error checking for bundled ffmpeg: {e}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not ffmpeg_path:
|
||||
# Try system ffmpeg if bundled not found
|
||||
system_ffmpeg = shutil.which("ffmpeg")
|
||||
if system_ffmpeg:
|
||||
ffmpeg_path = system_ffmpeg
|
||||
debug(f"Found system ffmpeg at: {ffmpeg_path}")
|
||||
else:
|
||||
# ffmpeg not found - log a debug message but don't fail
|
||||
# ffmpeg-python may still work with system installation, or user might not need it
|
||||
debug("ffmpeg not found on PATH. For best compatibility, install ffmpeg: Windows (use bundled or choco install ffmpeg), macOS (brew install ffmpeg), Linux (apt install ffmpeg or equivalent)")
|
||||
|
||||
return PlaywrightDefaults(
|
||||
browser=browser,
|
||||
|
||||
Reference in New Issue
Block a user