-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
48 lines (42 loc) · 1.25 KB
/
run.bat
File metadata and controls
48 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@echo off
cd /d "%~dp0"
REM Try python from PATH first (works if Python is properly installed)
where python >nul 2>&1
if %errorlevel% equ 0 (
set PYTHON=python
goto :install
)
REM Fallback: common install locations
for %%P in (
"%LOCALAPPDATA%\Programs\Python\Python313\python.exe"
"%LOCALAPPDATA%\Programs\Python\Python312\python.exe"
"%LOCALAPPDATA%\Programs\Python\Python311\python.exe"
"C:\Program Files\Python313\python.exe"
"C:\Program Files\Python312\python.exe"
"C:\Program Files\Python311\python.exe"
"C:\Python313\python.exe"
"C:\Python312\python.exe"
"C:\Python311\python.exe"
) do (
if exist %%P ( set PYTHON=%%P & goto :install )
)
echo Could not find Python. Please install Python 3.11+ and add it to your PATH.
pause
exit /b 1
:install
echo Installing / updating requirements...
"%PYTHON%" -m pip install -q -r requirements.txt
if %errorlevel% neq 0 (
echo pip install failed. See above for details.
pause
exit /b 1
)
REM Install Playwright browsers on first run (skips if already installed)
"%PYTHON%" -m playwright install chromium --with-deps >nul 2>&1
:run
"%PYTHON%" chub_ripper.py
if %errorlevel% neq 0 (
echo.
echo Script exited with an error. See above for details.
pause
)