set configuration for each extractor

This commit is contained in:
stefanodvx 2025-04-20 12:19:14 +02:00
parent 6baa965534
commit 0a63df9ce6
19 changed files with 337 additions and 175 deletions

View file

@ -14,6 +14,7 @@ type Extractor struct {
Host []string
IsDRM bool
IsRedirect bool
Client HTTPClient
Run func(*DownloadContext) (*ExtractorResponse, error)
}
@ -33,3 +34,10 @@ func (extractor *Extractor) NewMedia(
ExtractorCodeName: extractor.CodeName,
}
}
type ExtractorConfig struct {
HTTPProxy string `yaml:"http_proxy"`
HTTPSProxy string `yaml:"https_proxy"`
NoProxy string `yaml:"no_proxy"`
EdgeProxyURL string `yaml:"edge_proxy_url"`
}

7
models/http.go Normal file
View file

@ -0,0 +1,7 @@
package models
import "net/http"
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}