You've already forked bilibili-subtitle
fix字幕解析bug
This commit is contained in:
@@ -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())
|
||||||
|
Reference in New Issue
Block a user