From adf418f016d15bdb740ff6e804c9075b182d8920 Mon Sep 17 00:00:00 2001 From: timerzz Date: Mon, 1 Jul 2024 18:13:58 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=88=B0=E5=AD=97=E5=B9=95=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subtitles/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subtitles/client.go b/subtitles/client.go index f45cf51..032dd44 100644 --- a/subtitles/client.go +++ b/subtitles/client.go @@ -52,6 +52,9 @@ func (c *Client) GetSubtitles(url string) (string, error) { break } } + if subTitlesUrl == "" { + return "", fmt.Errorf("没有找到字幕") + } subtitles, err := c.callSubtitles(subTitlesUrl) if err != nil { return "", err @@ -124,6 +127,8 @@ func parseBilibiliUrl(bu string) (vid string, page int, err error) { if query.Get("p") != "" { pageStr := query.Get("p") page, _ = strconv.Atoi(pageStr) + } else { + page = 1 } return vid, page, nil }