Add yt-downloader

This commit is contained in:
2021-12-21 23:05:00 +01:00
committed by kjuulh
parent 0d3fae2ca5
commit 4b9583b08f
17 changed files with 449 additions and 134 deletions

View File

@@ -9,12 +9,11 @@ type Download struct {
ID string `json:"id"`
Status string `json:"status"`
Link string `json:"link"`
Data string `json:"data"`
}
func NewDownload(link string, data string) func(uuidGen uuid.Gen) (*Download, error) {
func NewDownload(link string) func(uuidGen uuid.Gen) (*Download, error) {
return func(uuidGen uuid.Gen) (*Download, error) {
if link == "" || data == "" {
if link == "" {
return nil, errors.New("A field was not valid")
}
@@ -22,7 +21,6 @@ func NewDownload(link string, data string) func(uuidGen uuid.Gen) (*Download, er
ID: uuidGen.Create(),
Status: "scheduled",
Link: link,
Data: data,
}, nil
}
}