From 24ab263f0b51577e8b8a231a9977853f830a5891 Mon Sep 17 00:00:00 2001 From: filesite Date: Mon, 20 May 2024 23:49:37 +0800 Subject: [PATCH] fix ended livestream poster get --- bot/Douyin.mjs | 4 ++-- test/scrap_test.mjs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bot/Douyin.mjs b/bot/Douyin.mjs index eadf087..39060b2 100644 --- a/bot/Douyin.mjs +++ b/bot/Douyin.mjs @@ -76,8 +76,8 @@ class Douyin extends HeroBot { elType = 'video'; if (!imgElem) { - //尝试获取用户头像作为封面图,兼容直播页面 - imgElem = await hero.querySelector('.avatar-component-avatar-container img'); + //尝试获取用户头像作为封面图,兼容直播已结束页面 + imgElem = await hero.querySelector('.reflow-content img'); elType = 'image'; if (!imgElem) { diff --git a/test/scrap_test.mjs b/test/scrap_test.mjs index bfbe5e6..eef5f94 100644 --- a/test/scrap_test.mjs +++ b/test/scrap_test.mjs @@ -26,6 +26,8 @@ import getConfigs from '../config.mjs'; //直播地址测试 url = 'https://v.douyin.com/i2WaMoAN/'; + //已结束直播 + url = 'https://v.douyin.com/i2W5TV4e/'; configs.heroTabOptions.timeoutMs = 20000; //所有内容加载完成超时