2 Commits

Author SHA1 Message Date
IndieKKY
149653ffac chore: release 1.11.13 2024-11-01 13:41:46 +08:00
IndieKKY
f977b5e238 fix字幕解析bug 2024-11-01 13:41:29 +08:00
2 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "bilibili-subtitle", "name": "bilibili-subtitle",
"version": "1.11.12", "version": "1.11.13",
"type": "module", "type": "module",
"description": "哔哩哔哩字幕列表", "description": "哔哩哔哩字幕列表",
"main": "index.js", "main": "index.js",

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())