Use download client properly when fetching first byte
This commit is contained in:
@@ -60,7 +60,6 @@ type ZurgConfig struct {
|
|||||||
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
|
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
|
||||||
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
|
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
|
||||||
Username string `yaml:"username" json:"username"`
|
Username string `yaml:"username" json:"username"`
|
||||||
VerifyDownloadLink bool `yaml:"verify_download_link" json:"verify_download_link"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z *ZurgConfig) GetConfig() ZurgConfig {
|
func (z *ZurgConfig) GetConfig() ZurgConfig {
|
||||||
|
|||||||
@@ -295,7 +295,8 @@ func (r *HTTPClient) CanFetchFirstByte(url string) bool {
|
|||||||
}
|
}
|
||||||
req.Header.Set("Range", "bytes=0-0")
|
req.Header.Set("Range", "bytes=0-0")
|
||||||
req = req.WithContext(ctx)
|
req = req.WithContext(ctx)
|
||||||
resp, err := r.client.Do(req)
|
|
||||||
|
resp, err := r.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user