Additional configs
This commit is contained in:
@@ -23,6 +23,8 @@ type ConfigInterface interface {
|
||||
GetUnrestrictWorkers() int
|
||||
GetReleaseUnrestrictAfterMs() int
|
||||
GetRateLimitSleepSeconds() int
|
||||
GetRealDebridTimeout() int
|
||||
GetRetriesUntilFailed() int
|
||||
}
|
||||
|
||||
type ZurgConfig struct {
|
||||
@@ -44,6 +46,8 @@ type ZurgConfig struct {
|
||||
PreferredHosts []string `yaml:"preferred_hosts"`
|
||||
ServeFromRclone bool `yaml:"serve_from_rclone"`
|
||||
ForceIPv6 bool `yaml:"force_ipv6"`
|
||||
RealDebridTimeout int `yaml:"realdebrid_timeout_secs"`
|
||||
RetriesUntilFailed int `yaml:"retries_until_failed"`
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetToken() string {
|
||||
@@ -144,3 +148,17 @@ func (z *ZurgConfig) GetRateLimitSleepSeconds() int {
|
||||
}
|
||||
return z.RateLimitSleepSeconds
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetRealDebridTimeout() int {
|
||||
if z.RealDebridTimeout == 0 {
|
||||
return 60
|
||||
}
|
||||
return z.RealDebridTimeout
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetRetriesUntilFailed() int {
|
||||
if z.RetriesUntilFailed == 0 {
|
||||
return 5
|
||||
}
|
||||
return z.RetriesUntilFailed
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *i
|
||||
if download, exists := t.DownloadCache.Get(link); exists {
|
||||
if c.ShouldServeFromRclone() && t.Api.CanFetchFirstByte(download.Download) {
|
||||
redirect(w, r, download.Download, c)
|
||||
return
|
||||
} else {
|
||||
err := gf.streamCachedLinkToResponse(download.Download, w, r, t, c, log)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user