frm

package module
v0.0.0-...-7e4bd8b Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 15 Imported by: 0

README

fm

func getReactInfo(authorization, channel, proxy string) (string, string) {
	fmt.Println(authorization, channel)
	headers := make(map[string]string)
	headers["Host"] = "discord.com"
	headers["x-discord-locale"] = "en-GB"
	headers["x-debug-options"] = "bugReporterEnabled"
	headers["accept-language"] = "en-US,en-RU;q=0.9,ru-RU;q=0.8"
	headers["authorization"] = authorization
	headers["user-agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) discord/0.0.266 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36"
	headers["accept"] = "*/*"
	headers["sec-fetch-site"] = "same-origin"
	headers["sec-fetch-mode"] = "cors"
	headers["sec-fetch-dest"] = "empty"

	data := req.FastData{
		Headers: headers,
		URL:     fmt.Sprintf("https://discord.com/api/v9/channels/%v/messages", channel),
		Method:  "GET",
	}

	fh := data.Build()

	fh.Client.Dial = fasthttpproxy.FasthttpHTTPDialer(proxy)
	err := fh.DoRequest()
	if err != nil {
		logger.Logger.Error().Err(err)
	}

	body := fh.Request.Body()
	authorID, _, _, err := jsonparser.Get(body, "[0]", "author", "id")
	if err != nil {
		logger.Logger.Error().Err(err)
	}
	customID, _, _, err := jsonparser.Get(body, "[0]", "components", "[0]", "components", "[0]", "custom_id")
	if err != nil {
		logger.Logger.Error().Err(err)
	}

	return string(authorID), string(customID)
}

Documentation

Index

Constants

View Source
const (
	Console = 0
	File    = 1
	Both    = 2
)

Variables

Functions

func InitLogger

func InitLogger(output int) error

Console = 0 File = 1 Console + File = 2

func OpenFile

func OpenFile(filename string, mode os.FileMode) *os.File

func ReadData

func ReadData(f *os.File) ([]string, error)

func WriteData

func WriteData(f *os.File, data string) error

Types

type Builder

type Builder interface {
	Build()
}

type FastData

type FastData struct {
	Client         *fasthttp.Client
	Headers        map[string]string
	URL            string
	Method         string
	ExpectedStatus int
	Payload        string
	Timeout        int
}

func (*FastData) Build

func (data *FastData) Build() *FastHttp

Build data for FastHttp

type FastHttp

type FastHttp struct {
	Client         *fasthttp.Client
	Request        *fasthttp.Request
	Response       *fasthttp.Response
	Timeout        time.Duration
	ExpectedStatus int
	MaxRetries     int
	Proxy          *Proxy
}

func (*FastHttp) DoRequest

func (fh *FastHttp) DoRequest() (err error)

Send request via FastHttp

type HCaptcha

type HCaptcha struct {
	ClienKey string `json:"clientKey,omitempty"`
	TaskType struct {
		Type        string `json:"type,omitempty"`
		WebsiteURL  string `json:"websiteURL,omitempty"`
		WebsiteKey  string `json:"websiteKey,omitempty"`
		IsInvisible bool   `json:"isInvisible,omitempty"`
		Data        string `json:"data,omitempty"`
		UserAgent   string `json:"userAgent,omitempty"`
		Cookies     string `json:"cookies,omitempty"`
	} `json:"task,omitempty"`
}

func (*HCaptcha) SolveCaptcha

func (c *HCaptcha) SolveCaptcha() (solution string, err error)

type NetData

type NetData struct {
	Client         *http.Client
	Headers        map[string]string
	URL            string
	Method         string
	ExpectedStatus int
	Payload        string
	Timeout        int
}

type NetHttp

type NetHttp struct {
	Client         *http.Client
	Request        *http.Request
	Response       *http.Response
	Timeout        time.Duration
	ExpectedStatus int
	MaxRetries     int
	Proxy          *Proxy
}

type Proxy

type Proxy struct {
	NetFmt       string
	FastFmt      string
	BansQuantity int
}

func GetProxies

func GetProxies(forSite string) []*Proxy

type Requester

type Requester interface {
	DoRequest()
}

type V2

type V2 struct {
	ClienKey string `json:"clientKey,omitempty"`
	TaskType struct {
		Type         string `json:"type,omitempty"`
		WebsiteURL   string `json:"websiteURL,omitempty"`
		WebsiteKey   string `json:"websiteKey,omitempty"`
		ReDataSValue string `json:"recaptchaDataSValue,omitempty"`
		UserAgent    string `json:"userAgent,omitempty"`
		Cookies      string `json:"cookies,omitempty"`
	} `json:"task,omitempty"`
}

type V3

type V3 struct {
	ClienKey string `json:"clientKey,omitempty"`
	TaskType struct {
		Type       string  `json:"type,omitempty"`
		WebsiteURL string  `json:"websiteURL,omitempty"`
		WebsiteKey string  `json:"websiteKey,omitempty"`
		MinScore   float32 `json:"minScore,omitempty"`
		PageAction string  `json:"pageAction,omitempty"`
	} `json:"task,omitempty"`
}

Jump to

Keyboard shortcuts

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