We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f50249e commit 6356527Copy full SHA for 6356527
src/content-script/site-adapters/bilibili/index.mjs
@@ -43,7 +43,9 @@ export default {
43
},
44
)
45
const infoData = await infoResponse.json()
46
- const subtitleUrl = infoData.data.subtitle.subtitles[0].subtitle_url
+ let subtitleUrl = infoData.data.subtitle.subtitles[0].subtitle_url
47
+ if (subtitleUrl.startsWith('//')) subtitleUrl = 'https:' + subtitleUrl
48
+ else if (!subtitleUrl.startsWith('http')) subtitleUrl = 'https://' + subtitleUrl
49
50
const subtitleResponse = await fetch(subtitleUrl)
51
const subtitleData = await subtitleResponse.json()
0 commit comments