Merge branch 'dreammis:main' into main
Browse files- myUtils/auth.py +4 -4
- start-win.bat +27 -0
myUtils/auth.py
CHANGED
|
@@ -7,7 +7,7 @@ from xhs import XhsClient
|
|
| 7 |
|
| 8 |
from conf import BASE_DIR
|
| 9 |
from utils.base_social_media import set_init_script
|
| 10 |
-
from utils.log import tencent_logger, kuaishou_logger
|
| 11 |
from pathlib import Path
|
| 12 |
from uploader.xhs_uploader.main import sign_local
|
| 13 |
|
|
@@ -27,13 +27,13 @@ async def cookie_auth_douyin(account_file):
|
|
| 27 |
# 等待“扫码登录”元素出现,超时 5 秒(如果 5 秒没出现,说明 cookie 有效)
|
| 28 |
try:
|
| 29 |
await page.get_by_text("扫码登录").wait_for(timeout=5000)
|
| 30 |
-
|
| 31 |
return False
|
| 32 |
except:
|
| 33 |
-
|
| 34 |
return True
|
| 35 |
except:
|
| 36 |
-
|
| 37 |
await context.close()
|
| 38 |
await browser.close()
|
| 39 |
return False
|
|
|
|
| 7 |
|
| 8 |
from conf import BASE_DIR
|
| 9 |
from utils.base_social_media import set_init_script
|
| 10 |
+
from utils.log import tencent_logger, kuaishou_logger, douyin_logger
|
| 11 |
from pathlib import Path
|
| 12 |
from uploader.xhs_uploader.main import sign_local
|
| 13 |
|
|
|
|
| 27 |
# 等待“扫码登录”元素出现,超时 5 秒(如果 5 秒没出现,说明 cookie 有效)
|
| 28 |
try:
|
| 29 |
await page.get_by_text("扫码登录").wait_for(timeout=5000)
|
| 30 |
+
douyin_logger.error("[+] cookie 失效,需要扫码登录")
|
| 31 |
return False
|
| 32 |
except:
|
| 33 |
+
douyin_logger.success("[+] cookie 有效")
|
| 34 |
return True
|
| 35 |
except:
|
| 36 |
+
douyin_logger.error("[+] 等待5秒 cookie 失效")
|
| 37 |
await context.close()
|
| 38 |
await browser.close()
|
| 39 |
return False
|
start-win.bat
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
TITLE One-Click Starter for social-auto-upload
|
| 3 |
+
|
| 4 |
+
ECHO ==================================================
|
| 5 |
+
ECHO Starting social-auto-upload Servers...
|
| 6 |
+
ECHO ==================================================
|
| 7 |
+
ECHO.
|
| 8 |
+
|
| 9 |
+
ECHO [1/2] Starting Python Backend Server in a new window...
|
| 10 |
+
REM The START command launches a new process.
|
| 11 |
+
REM The first quoted string "SAU Backend" is the title of the new window.
|
| 12 |
+
REM cmd /k runs the command and keeps the window open to show logs.
|
| 13 |
+
START "SAU Backend" cmd /k "python sau_backend.py"
|
| 14 |
+
|
| 15 |
+
ECHO [2/2] Starting Vue.js Frontend Server in another new window...
|
| 16 |
+
START "SAU Frontend" cmd /k "cd sau_frontend && npm run dev -- --host 0.0.0.0"
|
| 17 |
+
|
| 18 |
+
ECHO.
|
| 19 |
+
ECHO ==================================================
|
| 20 |
+
ECHO Done.
|
| 21 |
+
ECHO Two new windows have been opened for the backend
|
| 22 |
+
ECHO and frontend servers. You can monitor logs there.
|
| 23 |
+
ECHO ==================================================
|
| 24 |
+
ECHO.
|
| 25 |
+
|
| 26 |
+
ECHO This window will close in 10 seconds...
|
| 27 |
+
timeout /t 10 /nobreak > nul
|