there we go
This commit is contained in:
parent
2b8ca2a74d
commit
1c5856a243
10
Makefile
10
Makefile
|
@ -8,21 +8,21 @@ ensure-dist-dir:
|
||||||
|
|
||||||
dist-win: ensure-dist-dir
|
dist-win: ensure-dist-dir
|
||||||
# Build for Windows x64
|
# Build for Windows x64
|
||||||
GOOS=windows GOARCH=amd64 $(GOBUILD) -o dist/e6dl-windows-amd64.exe src/*.go
|
GOOS=windows GOARCH=amd64 $(GOBUILD) -o dist/e6dl-windows-amd64.exe main.go
|
||||||
|
|
||||||
dist-macos: ensure-dist-dir
|
dist-macos: ensure-dist-dir
|
||||||
# Build for macOS x64
|
# Build for macOS x64
|
||||||
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o dist/e6dl-darwin-amd64 src/*.go
|
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o dist/e6dl-darwin-amd64 main.go
|
||||||
|
|
||||||
dist-linux: ensure-dist-dir
|
dist-linux: ensure-dist-dir
|
||||||
# Build for Linux x64
|
# Build for Linux x64
|
||||||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o dist/e6dl-linux-amd64 src/*.go
|
GOOS=linux GOARCH=amd64 $(GOBUILD) -o dist/e6dl-linux-amd64 main.go
|
||||||
|
|
||||||
dist: dist-win dist-macos dist-linux
|
dist: dist-win dist-macos dist-linux
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@- mkdir -p bin
|
@- mkdir -p bin
|
||||||
$(GOBUILD) -o bin/e6dl src/*.go
|
$(GOBUILD) -o bin/e6dl main.go
|
||||||
@- chmod +x bin/e6dl
|
@- chmod +x bin/e6dl
|
||||||
|
|
||||||
install: build
|
install: build
|
||||||
|
@ -34,4 +34,4 @@ uninstall:
|
||||||
rm $(INSTALLPATH)/e6dl
|
rm $(INSTALLPATH)/e6dl
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@- go run src/*.go
|
@- go run main.go
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package e621
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package e621
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package e621
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
|
@ -5,6 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
|
"github.com/tjhorner/e6dl/e621"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -19,7 +21,7 @@ func main() {
|
||||||
|
|
||||||
fmt.Printf("Fetching posts for \"%v\" (limit %v)\n", *tags, *postLimit)
|
fmt.Printf("Fetching posts for \"%v\" (limit %v)\n", *tags, *postLimit)
|
||||||
|
|
||||||
posts, err := GetPostsForTags(*tags, *postLimit, *sfw)
|
posts, err := e621.GetPostsForTags(*tags, *postLimit, *sfw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -36,7 +38,7 @@ func main() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
successes, failures, _ := BeginDownload(&posts, saveDirectory, maxConcurrents)
|
successes, failures, _ := e621.BeginDownload(&posts, saveDirectory, maxConcurrents)
|
||||||
|
|
||||||
fmt.Printf("\nAll done! %d posts downloaded and saved. (%d failed to download)\n", *successes, *failures)
|
fmt.Printf("\nAll done! %d posts downloaded and saved. (%d failed to download)\n", *successes, *failures)
|
||||||
}
|
}
|
Loading…
Reference in New Issue