Skip to content

Commit

Permalink
chore: improve for bilibili
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Apr 14, 2023
1 parent 34cad26 commit 0065587
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/content-script/site-adapters/bilibili/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default {
const pagelistData = await pagelistResponse.json()
const videoList = pagelistData.data
const cid = videoList[p].cid
const title = videoList[p].part
let title
if (p === 0) title = document.querySelector('.video-title')?.textContent || videoList[p].part
else title = videoList[p].part

const infoResponse = await fetch(
`https://api.bilibili.com/x/player/v2?bvid=${bvid}&cid=${cid}`,
Expand All @@ -49,7 +51,7 @@ export default {
}

return cropText(
`用尽量简练的语言,联系视频标题,对视频进行内容摘要,视频标题为:"${title}",字幕内容为:\n${subtitleContent}`,
`用尽量简练的语言,联系视频标题,对视频进行内容摘要,同时仍要保留重要细节,视频标题为:"${title}",字幕内容为:\n${subtitleContent}`,
)
} catch (e) {
console.log(e)
Expand Down

0 comments on commit 0065587

Please sign in to comment.