1
uploader_tools/domains/loginer/v1/exported.go

45 lines
923 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 filess mass downloader
// Created for Uploaders group
// Copyright (c) 2012-2019 Vladimir "fat0troll" Hodakov
package loginerv1
import (
"github.com/rs/zerolog"
"gitlab.com/pztrn/flagger"
"gitlab.com/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()
}