cookies

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FBRequiredCookies = []MetaCookieName{FBCookieXS, FBCookieCUser}

Functions

This section is empty.

Types

type Cookies

type Cookies struct {
	Platform types.Platform

	IGWWWClaim string
	// contains filtered or unexported fields
}

func (*Cookies) Get

func (c *Cookies) Get(key MetaCookieName) string

func (*Cookies) GetMissingCookieNames

func (c *Cookies) GetMissingCookieNames() []MetaCookieName

func (*Cookies) GetUserID

func (c *Cookies) GetUserID() int64

func (*Cookies) GetViewports

func (c *Cookies) GetViewports() (width, height string)

func (*Cookies) IsLoggedIn

func (c *Cookies) IsLoggedIn() bool

func (*Cookies) MarshalJSON

func (c *Cookies) MarshalJSON() ([]byte, error)

func (*Cookies) Set

func (c *Cookies) Set(key MetaCookieName, value string)

func (*Cookies) String

func (c *Cookies) String() string

func (*Cookies) UnmarshalJSON

func (c *Cookies) UnmarshalJSON(data []byte) error

func (*Cookies) UpdateFromResponse

func (c *Cookies) UpdateFromResponse(r *http.Response)

func (*Cookies) UpdateValues

func (c *Cookies) UpdateValues(newValues map[string]string)

type MetaCookieName

type MetaCookieName string
const (
	// MetaCookieDatr seems to be a session ID that's displayed in security settings
	MetaCookieDatr             MetaCookieName = "datr"
	MetaCookieDevicePixelRatio MetaCookieName = "dpr"

	// FBCookieXS is the main session cookie for Facebook
	FBCookieXS MetaCookieName = "xs"
	// FBCookieCUser contains the user ID for Facebook
	FBCookieCUser MetaCookieName = "c_user"

	FBCookieSB               MetaCookieName = "sb"
	FBCookieFR               MetaCookieName = "fr"
	FBCookieWindowDimensions MetaCookieName = "wd"
	FBCookiePresence         MetaCookieName = "presence"
	FBCookieOO               MetaCookieName = "oo"

	// IGCookieSessionID is the main session cookie for Instagram
	IGCookieSessionID MetaCookieName = "sessionid"
	// IGCookieCSRFToken is the CSRF token for Instagram which must match the one in request headers
	IGCookieCSRFToken MetaCookieName = "csrftoken"
	// IGCookieDSUserID contains the user ID for Instagram
	IGCookieDSUserID MetaCookieName = "ds_user_id"

	IGCookieMachineID MetaCookieName = "mid"
	IGCookieDeviceID  MetaCookieName = "ig_did"
)

Jump to

Keyboard shortcuts

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