cookiecloud

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:     "cookiecloud",
	Aliases: []string{"cc"},
	Short:   "Use cookiecloud to sync site cookies or import sites.",
	Long: `Use cookiecloud to sync site cookies or import sites.
To use this feature, add the cookiecloud servers to config file, e.g. :

ptool.toml
----------
[[cookieclouds]]
server = 'https://cookiecloud.example.com'
uuid = 'uuid'
password = 'password'
----------

See also:
* CookieCloud: https://github.com/easychen/CookieCloud`,
	Args: cobra.MatchAll(cobra.ExactArgs(0), cobra.OnlyValidArgs),
}

Functions

func ParseProfile

func ParseProfile(profile string) []*config.CookiecloudConfigStruct

Types

type Ccdata_struct

type Ccdata_struct struct {
	Label string
	Sites []string
	Data  *CookiecloudData
}
type Cookie struct {
	Domain string
	Name   string
	Value  string
	Path   string
}

type CookieCloudBody

type CookieCloudBody struct {
	Uuid      string `json:"uuid,omitempty"`
	Encrypted string `json:"encrypted,omitempty"`
}

type CookiecloudData

type CookiecloudData struct {
	// host => [{name,value,domain}...]
	Cookie_data map[string][]map[string]any `json:"cookie_data"`
}

func GetCookiecloudData

func GetCookiecloudData(server string, uuid string, password string,
	proxy string, timeout int64) (*CookiecloudData, error)

If proxy is empty, will try to get proxy from HTTP_PROXY & HTTPS_PROXY envs.

func (*CookiecloudData) GetEffectiveCookie

func (cookiecloudData *CookiecloudData) GetEffectiveCookie(urlOrDomain string, all bool, format string) (string, error)

If all is false, only return cookies which is valid for both the hostname and path part of the urlOrDomain, in the case of urlOrDomain being a domain, it's path is assumed to be "/". If all is true, path check is skipped and all cookies which domain match will be included. format: "http" - http request "Cookie" header; "js" - JavaScript document.cookie="" code snippet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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