Force ipv6 setting
This commit is contained in:
@@ -19,6 +19,7 @@ type ConfigInterface interface {
|
||||
EnableRetainRDTorrentName() bool
|
||||
GetRandomPreferredHost() string
|
||||
ShouldServeFromRclone() bool
|
||||
ShouldForceIPv6() bool
|
||||
}
|
||||
|
||||
type ZurgConfig struct {
|
||||
@@ -36,6 +37,7 @@ type ZurgConfig struct {
|
||||
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name"`
|
||||
PreferredHosts []string `yaml:"preferred_hosts"`
|
||||
ServeFromRclone bool `yaml:"serve_from_rclone"`
|
||||
ForceIPv6 bool `yaml:"force_ipv6"`
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetToken() string {
|
||||
@@ -111,3 +113,7 @@ func (z *ZurgConfig) GetRandomPreferredHost() string {
|
||||
func (z *ZurgConfig) ShouldServeFromRclone() bool {
|
||||
return z.ServeFromRclone
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) ShouldForceIPv6() bool {
|
||||
return z.ForceIPv6
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ func (gf *GetFile) HandleGetRequest(w http.ResponseWriter, r *http.Request, t *i
|
||||
} else {
|
||||
gf.streamFileToResponse(file, resp.Download, w, r, t, c, log)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +177,9 @@ func (gf *GetFile) playErrorVideo(link string, w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
if c.ShouldServeFromRclone() {
|
||||
redirect(w, r, resp.Download, c)
|
||||
} else {
|
||||
gf.streamFileToResponse(nil, resp.Download, w, r, t, c, log)
|
||||
}
|
||||
gf.streamFileToResponse(nil, resp.Download, w, r, t, c, log)
|
||||
}
|
||||
|
||||
func redirect(w http.ResponseWriter, r *http.Request, url string, c config.ConfigInterface) {
|
||||
|
||||
Reference in New Issue
Block a user