diff --git a/extractors/bilibili/bilibili.go b/extractors/bilibili/bilibili.go index b07a87c6d..b65a1ba45 100644 --- a/extractors/bilibili/bilibili.go +++ b/extractors/bilibili/bilibili.go @@ -500,7 +500,7 @@ func getExtFromMimeType(mimeType string) string { func getSubTitleCaptionPart(aid int, cid int) *extractors.CaptionPart { jsonString, err := request.Get( - fmt.Sprintf("http://api.bilibili.com/x/web-interface/view?aid=%d&cid=%d", aid, cid), referer, nil, + fmt.Sprintf("http://api.bilibili.com/x/player/wbi/v2?aid=%d&cid=%d", aid, cid), referer, nil, ) if err != nil { return nil @@ -512,7 +512,7 @@ func getSubTitleCaptionPart(aid int, cid int) *extractors.CaptionPart { } return &extractors.CaptionPart{ Part: extractors.Part{ - URL: stu.Data.SubtitleInfo.SubtitleList[0].SubtitleUrl, + URL: fmt.Sprintf("https:%s", stu.Data.SubtitleInfo.SubtitleList[0].SubtitleUrl), Ext: "srt", }, Transform: subtitleTransform, diff --git a/extractors/bilibili/types.go b/extractors/bilibili/types.go index 815cf9932..5f90b5eb9 100644 --- a/extractors/bilibili/types.go +++ b/extractors/bilibili/types.go @@ -131,7 +131,7 @@ type subtitleProperty struct { type subtitleInfo struct { AllowSubmit bool `json:"allow_submit"` - SubtitleList []subtitleProperty `json:"list"` + SubtitleList []subtitleProperty `json:"subtitles"` } type bilibiliWebInterfaceData struct {