set configuration for each extractor
This commit is contained in:
parent
6baa965534
commit
0a63df9ce6
19 changed files with 337 additions and 175 deletions
|
@ -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
7
models/http.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package models
|
||||
|
||||
import "net/http"
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(req *http.Request) (*http.Response, error)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue