github.com/fzfile/BaiduPCS-Go@v0.0.0-20200606205115-4408961cf336/internal/pcsfunctions/pcsdownload/download_link.go (about) 1 package pcsdownload 2 3 import ( 4 "github.com/fzfile/BaiduPCS-Go/baidupcs" 5 "github.com/fzfile/BaiduPCS-Go/internal/pcsconfig" 6 "net/url" 7 ) 8 9 func GetLocateDownloadLinks(pcs *baidupcs.BaiduPCS, pcspath string) (dlinks []*url.URL, err error) { 10 dInfo, pcsError := pcs.LocateDownload(pcspath) 11 if pcsError != nil { 12 return nil, pcsError 13 } 14 15 us := dInfo.URLStrings(pcsconfig.Config.EnableHTTPS) 16 if len(us) == 0 { 17 return nil, ErrDlinkNotFound 18 } 19 20 return us, nil 21 }