fix字幕解析bug

This commit is contained in:
IndieKKY
2024-11-01 13:41:29 +08:00
parent c13ef4597b
commit f977b5e238

View File

@@ -167,7 +167,7 @@ const debug = (...args: any[]) => {
ctime = pages[0].ctime ctime = pages[0].ctime
author = pages[0].owner?.name author = pages[0].owner?.name
title = pages[0].part title = pages[0].part
await fetch(`https://api.bilibili.com/x/player/v2?aid=${aid}&cid=${cid}`, { credentials: 'include' }).then(res => res.json()).then(res => { await fetch(`https://api.bilibili.com/x/player/wbi/v2?aid=${aid}&cid=${cid}`, { credentials: 'include' }).then(res => res.json()).then(res => {
subtitles = res.data.subtitle.subtitles subtitles = res.data.subtitle.subtitles
}) })
} else {//bvxxx } else {//bvxxx
@@ -179,7 +179,7 @@ const debug = (...args: any[]) => {
author = res.data.owner?.name author = res.data.owner?.name
pages = res.data.pages pages = res.data.pages
}) })
await fetch(`https://api.bilibili.com/x/player/v2?aid=${aid}&cid=${cid}`, { credentials: 'include' }).then(res => res.json()).then(res => { await fetch(`https://api.bilibili.com/x/player/wbi/v2?aid=${aid}&cid=${cid}`, { credentials: 'include' }).then(res => res.json()).then(res => {
subtitles = res.data.subtitle.subtitles subtitles = res.data.subtitle.subtitles
}) })
} }
@@ -226,7 +226,7 @@ const debug = (...args: any[]) => {
lastAid = aid lastAid = aid
lastCid = cid lastCid = cid
if (aid && cid) { if (aid && cid) {
fetch(`https://api.bilibili.com/x/player/v2?aid=${aid}&cid=${cid}`, { fetch(`https://api.bilibili.com/x/player/wbi/v2?aid=${aid}&cid=${cid}`, {
credentials: 'include', credentials: 'include',
}) })
.then(res => res.json()) .then(res => res.json())