user

package
v0.0.0-...-cb6fcfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientForUser

func CreateClientForUser(userModel user_models.User) (client util.EaClient, err bst_models.Error)

createClientForUser will generate a http client for the provided user model. This is intended to only be used for this specific user model, as it will use cookies from the database for eagate integration.

func FindCharacterFromMD5

func FindCharacterFromMD5(md5 string) (string, bst_models.Error)

FindCharacterFromMD5 will attempt to locate the Captcha MD5 in the existing MD5 slices. Returns the character name or unknown and an error if not found.

func GetCookieFromEaGate

func GetCookieFromEaGate(username string, password string, otp string, client util.EaClient) bst_models.Error

GetCookieFromEaGate will submit a request to login as the given username with the provided password and optionally, otp.

func GetMD5FromImageData

func GetMD5FromImageData(imageData []byte) []byte

GetMD5FromImageData

func LoadImageDataFromUri

func LoadImageDataFromUri(uri string) ([]byte, bst_models.Error)

LoadMD5OfImageURI will attempt to Get an image from the provided URI, and calculate the MD5 checksum of this image. Returns the MD5 checksum as a string and an error if the process fails.

func ProfileEaSubscriptionState

func ProfileEaSubscriptionState(client util.EaClient) (subscriptionType string, err bst_models.Error)

func RunUpdatesOnAllEaUsers

func RunUpdatesOnAllEaUsers()

func SolveCaptcha

func SolveCaptcha(captchaData Captcha) (session string, correct string, err bst_models.Error)

SolveCaptcha will load a Konami Captcha and attempt to solve it. It returns a string containing the captcha session, a slice containing all correct keys, and any errors encountered.

Types

type Captcha

type Captcha struct {
	Data struct {
		CorrectPic string `json:"correct_pic"`
		Kcsess     string `json:"kcsess"`
		ChoiceList []struct {
			Attr   string `json:"attr"`
			ImgURL string `json:"img_url"`
			Key    string `json:"key"`
		} `json:"choicelist"`
	} `json:"data"`
}

Captcha defines Konami Captcha JSON

func LoadCaptchaData

func LoadCaptchaData(client util.EaClient) (captchaData Captcha, err bst_models.Error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL