This commit is contained in:
zjf 2025-05-27 18:33:39 +08:00
parent c71fbac3ce
commit 10e13725ad
1 changed files with 7 additions and 7 deletions

View File

@ -105,17 +105,17 @@ async def check_live_status(webcast_id: str, page: Optional[Page] = None) -> boo
# 监听网络响应 # 监听网络响应
async def handle_response(response): async def handle_response(response):
if "live.douyin.com/live/promotions/page" in response.url: if "live.douyin.com/live/promotions/page" in response.url:
print(f"URL: {response.url}") logger.debug(f"URL: {response.url}")
print(f"Status: {response.status}") logger.debug(f"Status: {response.status}")
# 获取响应内容 # 获取响应内容
try: try:
json_data = await response.json() json_data = await response.json()
print("json_data:",json.dumps(json_data, indent=2, ensure_ascii=False)) logger.debug(f"json_data:{json.dumps(json_data, indent=2, ensure_ascii=False)}")
print("top_promotion:",json_data["top_promotion"]) logger.debug(f'top_promotion:{json_data["top_promotion"]}')
print("promotions:",json_data["promotions"]) logger.debug(f'promotions:{json_data["promotions"]}')
print("total:",json_data["total"]) logger.debug(f'total:{json_data["total"]}')
except: except:
print("Non-JSON response") logger.debug("Non-JSON response")