1
uploader_tools/internal/services/loginer/exported.go

45 lines
924 B
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 files mass downloader
// Created for Uploaders group
// Copyright (c) 2012-2022 Vladimir "fat0troll" Hodakov
package loginer
import (
"github.com/rs/zerolog"
"gitlab.com/pztrn/flagger"
"lab.hodakov.me/fat0troll/uploader_tools/internal/context"
)
var (
c *context.Context
dlog zerolog.Logger
)
// New initializes package
func New(cc *context.Context) {
c = cc
dlog = c.Logger.With().Str("модуль", "loginer").Int("версия", 1).Logger()
_ = c.Flagger.AddFlag(&flagger.Flag{
Name: "auth",
Description: "Запустить аутентификацию на сайте NNM-Club с начала.",
Type: "bool",
DefaultValue: false,
})
dlog.Info().Msg("Модуль инициализирован")
}
// Process handles authorization
func Process() {
auth, _ := c.Flagger.GetBoolValue("auth")
if auth {
login()
}
checkConfig()
obtainCookies()
}