Browse Source

fix ended livestream poster get

master
filesite 6 months ago
parent
commit
24ab263f0b
  1. 4
      bot/Douyin.mjs
  2. 2
      test/scrap_test.mjs

4
bot/Douyin.mjs

@ -76,8 +76,8 @@ class Douyin extends HeroBot { @@ -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) {

2
test/scrap_test.mjs

@ -26,6 +26,8 @@ import getConfigs from '../config.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; //所有内容加载完成超时

Loading…
Cancel
Save