1
uploader_tools/domains/fetcher/v1/fetcher.go

37 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// NNM-Club torrent filess mass downloader
// Created for Uploaders group
// Copyright (c) 2012-2019 Vladimir "fat0troll" Hodakov
package fetcherv1
import (
"strconv"
"time"
)
func fetch(forumID int) {
startPage := "https://" + c.Config.URL + "/forum/viewforum.php?f=" + strconv.Itoa(forumID)
time.Sleep(5 * time.Second)
startPageFile, err := dumpForumPage(startPage)
if err != nil {
dlog.Error().Err(err).Msg("Не удалось получить данные с форума")
}
if uberDebug {
dlog.Info().Str("имя файла", startPageFile).Msg("Получена стартовая страница форума")
}
err = setQuerier(startPageFile, "forumPage", 1)
if err != nil {
dlog.Fatal().Err(err).Msg("Не удалось создать обработчик для страницы")
}
dlog.Info().Str("название форума", getForumName(forumPages[1])).Msg("Определён форум для загрузки")
getNavigation(forumPages[1])
downloadAdditionalPages()
}