Merge branch 'main' into dev

This commit is contained in:
huangxd- committed 2025-09-20 08:46:47 +08:00
commit 95395bc324
1 file changed
+13 -3
+13 -3
View File
@@ -889,8 +889,18 @@ async function fetchTencentVideo(inputUrl) {
content: "",
};
content.timepoint = item.time_offset / 1000;
if (item.content_style?.color) {
log("log", "弹幕颜色:", JSON.stringify(item.content_style.color));
if (item.content_style && item.content_style !== "") {
try {
const content_style = JSON.parse(item.content_style);
// 优先使用渐变色的第一个颜色,否则使用基础色
if (content_style.gradient_colors && content_style.gradient_colors.length > 0) {
content.color = parseInt(content_style.gradient_colors[0].replace("#", ""), 16);
} else if (content_style.color && content_style.color !== "ffffff") {
content.color = parseInt(content_style.color.replace("#", ""), 16);
}
} catch (e) {
// JSON 解析失败,使用默认白色
}
}
content.content = item.content;
contents.push(content);
@@ -1021,7 +1031,7 @@ async function fetchIqiyi(inputUrl) {
const danmaku = extract(xml, "content");
const showTime = extract(xml, "showTime");
const color = extract(xml, "color");
const step = Math.ceil(danmaku.length * datas.length / 10000);
const step = 1;
for (let i = 0; i < danmaku.length; i += step) {
const content = {