34 lines
1.1 KiB
Batchfile
34 lines
1.1 KiB
Batchfile
@echo off
|
|
chcp 65001 >nul
|
|
title 丰享登录并同步 Cookie
|
|
cd /d "%~dp0"
|
|
|
|
echo ============================================
|
|
echo 登录丰享商家端,并把 Cookie 同步到服务器
|
|
echo ============================================
|
|
echo.
|
|
|
|
set "PYTHON="
|
|
if exist ".venv\Scripts\python.exe" set "PYTHON=.venv\Scripts\python.exe"
|
|
if not defined PYTHON if defined FX_PYTHON set "PYTHON=%FX_PYTHON%"
|
|
if not defined PYTHON set "PYTHON=python"
|
|
|
|
"%PYTHON%" -c "import playwright" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo [准备] 安装 Playwright...
|
|
"%PYTHON%" -m pip install -r requirements-local.txt
|
|
"%PYTHON%" -m playwright install chromium
|
|
)
|
|
|
|
:: 服务器地址:优先用环境变量,也可直接改这一行
|
|
if not defined FX_SERVER set "FX_SERVER=http://192.168.8.210:52100"
|
|
:: 上传用的 token 自动从本地 config.yaml 的 admin.token 读取;也可用 FX_ADMIN_TOKEN 覆盖
|
|
|
|
echo [1/2] 打开浏览器登录丰享...
|
|
echo.
|
|
"%PYTHON%" fengxiang_scraper.py --upload --server "%FX_SERVER%"
|
|
|
|
echo.
|
|
echo [2/2] 完成。若提示上传失败,请检查服务器地址 / config.yaml 里的 admin.token。
|
|
pause
|