parent
f88fd83d4a
commit
d53eecc229
@ -3,6 +3,7 @@ package febbox
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"github.com/alist-org/alist/v3/drivers/base"
|
"github.com/alist-org/alist/v3/drivers/base"
|
||||||
"github.com/alist-org/alist/v3/internal/op"
|
"github.com/alist-org/alist/v3/internal/op"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
@ -135,6 +136,9 @@ func (d *FebBox) getDownloadLink(id string, ip string) (string, error) {
|
|||||||
if err = json.Unmarshal(res, &fileDownloadResp); err != nil {
|
if err = json.Unmarshal(res, &fileDownloadResp); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
if len(fileDownloadResp.Data) == 0 {
|
||||||
|
return "", fmt.Errorf("can not get download link, code:%d, msg:%s", fileDownloadResp.Code, fileDownloadResp.Msg)
|
||||||
|
}
|
||||||
|
|
||||||
return fileDownloadResp.Data[0].DownloadURL, nil
|
return fileDownloadResp.Data[0].DownloadURL, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user