Init
This commit is contained in:
parent
264c97183e
commit
3faede7b1c
74 changed files with 6228 additions and 1 deletions
34
models/ext.go
Normal file
34
models/ext.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"govd/enums"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
type Extractor struct {
|
||||
Name string
|
||||
CodeName string
|
||||
Type enums.ExtractorType
|
||||
Category enums.ExtractorCategory
|
||||
URLPattern *regexp.Regexp
|
||||
IsDRM bool
|
||||
IsRedirect bool
|
||||
|
||||
Run func(*DownloadContext) (*ExtractorResponse, error)
|
||||
}
|
||||
|
||||
type ExtractorResponse struct {
|
||||
MediaList []*Media
|
||||
URL string // redirected URL
|
||||
}
|
||||
|
||||
func (extractor *Extractor) NewMedia(
|
||||
contentID string,
|
||||
contentURL string,
|
||||
) *Media {
|
||||
return &Media{
|
||||
ContentID: contentID,
|
||||
ContentURL: contentURL,
|
||||
ExtractorCodeName: extractor.CodeName,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue