diff --git a/reduxer/example.go b/reduxer/example.go index 86a91625..23ee2951 100644 --- a/reduxer/example.go +++ b/reduxer/example.go @@ -16,57 +16,49 @@ func BundleExample() Reduxer { Img: Asset{ Local: "/path/to/image", Remote: Remote{ - Anonfile: "https://anonfiles.com/FbZfSa9eu4", - Catbox: "https://files.catbox.moe/9u6yvu.png", + Catbox: "https://files.catbox.moe/9u6yvu.png", }, }, PDF: Asset{ Local: "/path/to/pdf", Remote: Remote{ - Anonfile: "https://anonfiles.com/r4G8Sb90ud", - Catbox: "https://files.catbox.moe/q73uqh.pdf", + Catbox: "https://files.catbox.moe/q73uqh.pdf", }, }, Raw: Asset{ Local: "/path/to/htm", Remote: Remote{ - Anonfile: "https://anonfiles.com/pbG4Se94ua", - Catbox: "https://files.catbox.moe/bph1g6.htm", + Catbox: "https://files.catbox.moe/bph1g6.htm", }, }, Txt: Asset{ Local: "/path/to/txt", Remote: Remote{ - Anonfile: "https://anonfiles.com/naG6S09bu1", - Catbox: "https://files.catbox.moe/wwrby6.txt", + Catbox: "https://files.catbox.moe/wwrby6.txt", }, }, HAR: Asset{ Local: "/path/to/har", Remote: Remote{ - Anonfile: "https://anonfiles.com/n1paZfB3ub", - Catbox: "https://files.catbox.moe/3agtva.har", + Catbox: "https://files.catbox.moe/3agtva.har", }, }, HTM: Asset{ Local: "/path/to/single-htm", Remote: Remote{ - Anonfile: "https://anonfiles.com/v4G4S09abc", - Catbox: "", + Catbox: "", }, }, WARC: Asset{ Local: "/path/to/warc", Remote: Remote{ - Anonfile: "https://anonfiles.com/v4G4S09auc", - Catbox: "invalid-url-moe/kkai0w.warc", + Catbox: "invalid-url-moe/kkai0w.warc", }, }, Media: Asset{ Local: "", Remote: Remote{ - Anonfile: "", - Catbox: "", + Catbox: "", }, }, }, diff --git a/reduxer/reduxer.go b/reduxer/reduxer.go index 06244af6..f768d774 100644 --- a/reduxer/reduxer.go +++ b/reduxer/reduxer.go @@ -19,7 +19,6 @@ import ( "github.com/go-shiori/go-readability" "github.com/go-shiori/obelisk" - "github.com/wabarc/go-anonfile" "github.com/wabarc/go-catbox" "github.com/wabarc/helper" "github.com/wabarc/logger" @@ -73,8 +72,7 @@ type Asset struct { // Remote represents the file on the remote server. type Remote struct { - Anonfile string - Catbox string + Catbox string } // Src represents the requested url. @@ -317,7 +315,6 @@ func remotely(ctx context.Context, artifact *Artifact) (err error) { } cat := catbox.New(ingress.Client()) - anon := anonfile.NewAnonfile(ingress.Client()) g, _ := errgroup.WithContext(ctx) var mu sync.RWMutex @@ -333,22 +330,12 @@ func remotely(ctx context.Context, artifact *Artifact) (err error) { g.Go(func() error { var remote Remote mu.Lock() - func() { - r, e := anon.Upload(asset.Local) - if e != nil { - err = errors.Wrap(err, fmt.Sprintf("upload %s to anonfiles failed: %v", asset.Local, e)) - } else { - remote.Anonfile = r.Short() - } - }() - func() { - c, e := cat.Upload(asset.Local) - if e != nil { - err = errors.Wrap(err, fmt.Sprintf("upload %s to catbox failed: %v", asset.Local, e)) - } else { - remote.Catbox = c - } - }() + c, e := cat.Upload(asset.Local) + if e != nil { + err = errors.Wrap(err, fmt.Sprintf("upload %s to catbox failed: %v", asset.Local, e)) + } else { + remote.Catbox = c + } asset.Remote = remote mu.Unlock() return nil