1

Fix downloading of forums with many pages

This commit is contained in:
2021-12-20 17:45:05 +04:00
parent 2de559f5cb
commit 21d9108539
5 changed files with 48 additions and 21 deletions

View File

@@ -5,6 +5,7 @@
package fetcher
import (
"fmt"
"os"
"path/filepath"
"strconv"
@@ -89,7 +90,7 @@ func download(topic *forumTopic) {
}
func fetch(forumID int) {
startPage := "https://" + c.Config.URL + "/forum/viewforum.php?f=" + strconv.Itoa(forumID)
startPage := fmt.Sprintf("https://%s/forum/viewforum.php?f=%d", c.Config.URL, forumID)
time.Sleep(5 * time.Second)
@@ -109,9 +110,7 @@ func fetch(forumID int) {
dlog.Info().Str("название форума", getForumName(forumPages[1])).Msg("Определён форум для загрузки")
getNavigation(forumPages[1])
downloadAdditionalPages()
downloadAdditionalPages(forumID)
for _, forumPage := range forumPages {
getTopics(forumPage)