feat: pikpak video use media link
This commit is contained in:
parent
c63e05983d
commit
8f19c45a81
@ -119,9 +119,14 @@ func (driver PikPak) Link(args base.Args, account *model.Account) (*base.Link, e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &base.Link{
|
link := base.Link{
|
||||||
Url: resp.WebContentLink,
|
Url: resp.WebContentLink,
|
||||||
}, nil
|
}
|
||||||
|
if len(resp.Medias) > 0 && resp.Medias[0].Link.Url != "" {
|
||||||
|
log.Debugln("use media link")
|
||||||
|
link.Url = resp.Medias[0].Link.Url
|
||||||
|
}
|
||||||
|
return &link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (driver PikPak) Path(path string, account *model.Account) (*model.File, []model.File, error) {
|
func (driver PikPak) Path(path string, account *model.Account) (*model.File, []model.File, error) {
|
||||||
|
@ -144,6 +144,37 @@ type File struct {
|
|||||||
Size string `json:"size"`
|
Size string `json:"size"`
|
||||||
ThumbnailLink string `json:"thumbnail_link"`
|
ThumbnailLink string `json:"thumbnail_link"`
|
||||||
WebContentLink string `json:"web_content_link"`
|
WebContentLink string `json:"web_content_link"`
|
||||||
|
Medias []Media `json:"medias"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Media struct {
|
||||||
|
MediaId string `json:"media_id"`
|
||||||
|
MediaName string `json:"media_name"`
|
||||||
|
Video struct {
|
||||||
|
Height int `json:"height"`
|
||||||
|
Width int `json:"width"`
|
||||||
|
Duration int `json:"duration"`
|
||||||
|
BitRate int `json:"bit_rate"`
|
||||||
|
FrameRate int `json:"frame_rate"`
|
||||||
|
VideoCodec string `json:"video_codec"`
|
||||||
|
AudioCodec string `json:"audio_codec"`
|
||||||
|
VideoType string `json:"video_type"`
|
||||||
|
} `json:"video"`
|
||||||
|
Link struct {
|
||||||
|
Url string `json:"url"`
|
||||||
|
Token string `json:"token"`
|
||||||
|
Expire time.Time `json:"expire"`
|
||||||
|
} `json:"link"`
|
||||||
|
NeedMoreQuota bool `json:"need_more_quota"`
|
||||||
|
VipTypes []interface{} `json:"vip_types"`
|
||||||
|
RedirectLink string `json:"redirect_link"`
|
||||||
|
IconLink string `json:"icon_link"`
|
||||||
|
IsDefault bool `json:"is_default"`
|
||||||
|
Priority int `json:"priority"`
|
||||||
|
IsOrigin bool `json:"is_origin"`
|
||||||
|
ResolutionName string `json:"resolution_name"`
|
||||||
|
IsVisible bool `json:"is_visible"`
|
||||||
|
Category string `json:"category"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (driver PikPak) FormatFile(file *File) *model.File {
|
func (driver PikPak) FormatFile(file *File) *model.File {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user