Skip to content

Commit

Permalink
dramatically sped up post fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
TiltedToast committed Sep 23, 2022
1 parent c0ede1f commit 3cdab0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func fetchPostsFromPage(tags []string, totalPageAmount int, options inputOptions
tagString += url.QueryEscape(tag) + "+"
}

postsUrl := fmt.Sprintf("https://danbooru.donmai.us/posts.json?page=%d&tags=%s", currentPage, tagString)
postsUrl := fmt.Sprintf("https://danbooru.donmai.us/posts.json?page=%d&tags=%s&limit=1000", currentPage, tagString)

// Credentials to get access to extra features for Danbooru Gold users
postsUrl += "&login=" + os.Getenv("LOGIN_NAME") + "&api_key=" + os.Getenv("API_KEY")
Expand Down Expand Up @@ -304,7 +304,7 @@ func getTotalPages(tags []string) int {
for _, tag := range tags {
tagString += url.QueryEscape(tag) + "+"
}
url := fmt.Sprintf("https://danbooru.donmai.us/posts?tags=%s", tagString)
url := fmt.Sprintf("https://danbooru.donmai.us/posts?tags=%s&limit=1000", tagString)

// Credentials to get access to extra features for Danbooru Gold users
url += "&login=" + os.Getenv("LOGIN_NAME") + "&api_key=" + os.Getenv("API_KEY")
Expand Down

0 comments on commit 3cdab0a

Please sign in to comment.