fix: 修复Docker中打包的前端请求地址为本地

This commit is contained in:
听风
2025-11-20 14:58:49 +08:00
parent 75a8e8cf29
commit 9d1bfc6525
3 changed files with 28 additions and 13 deletions
+9 -6
View File
@@ -5,15 +5,16 @@ import os
from playwright.async_api import async_playwright
from xhs import XhsClient
from conf import BASE_DIR
from conf import BASE_DIR, LOCAL_CHROME_HEADLESS
from utils.base_social_media import set_init_script
from utils.log import tencent_logger, kuaishou_logger
from pathlib import Path
from uploader.xhs_uploader.main import sign_local
async def cookie_auth_douyin(account_file):
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
browser = await playwright.chromium.launch(headless=LOCAL_CHROME_HEADLESS)
context = await browser.new_context(storage_state=account_file)
context = await set_init_script(context)
# 创建一个新的页面
@@ -38,9 +39,10 @@ async def cookie_auth_douyin(account_file):
await browser.close()
return False
async def cookie_auth_tencent(account_file):
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
browser = await playwright.chromium.launch(headless=LOCAL_CHROME_HEADLESS)
context = await browser.new_context(storage_state=account_file)
context = await set_init_script(context)
# 创建一个新的页面
@@ -55,9 +57,10 @@ async def cookie_auth_tencent(account_file):
tencent_logger.success("[+] cookie 有效")
return True
async def cookie_auth_ks(account_file):
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
browser = await playwright.chromium.launch(headless=LOCAL_CHROME_HEADLESS)
context = await browser.new_context(storage_state=account_file)
context = await set_init_script(context)
# 创建一个新的页面
@@ -76,7 +79,7 @@ async def cookie_auth_ks(account_file):
async def cookie_auth_xhs(account_file):
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
browser = await playwright.chromium.launch(headless=LOCAL_CHROME_HEADLESS)
context = await browser.new_context(storage_state=account_file)
context = await set_init_script(context)
# 创建一个新的页面
@@ -99,7 +102,7 @@ async def cookie_auth_xhs(account_file):
return True
async def check_cookie(type,file_path):
async def check_cookie(type, file_path):
match type:
# 小红书
case 1: