pikpak_share

package
v3.37.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AndroidClientID      = "YNxT9w7GMdWvEOKa"
	AndroidClientSecret  = "dbw2OtmVEeuUvIptb1Coyg"
	AndroidClientVersion = "1.48.3"
	AndroidPackageName   = "com.pikcloud.pikpak"
	AndroidSdkVersion    = "2.0.4.204101"
	WebClientID          = "YUMx5nI8ZU8Ap8pm"
	WebClientSecret      = "dbw2OtmVEeuUvIptb1Coyg"
	WebClientVersion     = "2.0.0"
	WebPackageName       = "mypikpak.com"
	WebSdkVersion        = "8.0.3"
	PCClientID           = "YvtoWO6GNHiuCl7x"
	PCClientSecret       = "1NIH5R1IEe2pAxZE3hv3uA"
	PCClientVersion      = "undefined" // 2.5.6.4831
	PCPackageName        = "mypikpak.com"
	PCSdkVersion         = "8.0.3"
)

Variables

View Source
var AndroidAlgorithms = []string{
	"aDhgaSE3MsjROCmpmsWqP1sJdFJ",
	"+oaVkqdd8MJuKT+uMr2AYKcd9tdWge3XPEPR2hcePUknd",
	"u/sd2GgT2fTytRcKzGicHodhvIltMntA3xKw2SRv7S48OdnaQIS5mn",
	"2WZiae2QuqTOxBKaaqCNHCW3olu2UImelkDzBn",
	"/vJ3upic39lgmrkX855Qx",
	"yNc9ruCVMV7pGV7XvFeuLMOcy1",
	"4FPq8mT3JQ1jzcVxMVfwFftLQm33M7i",
	"xozoy5e3Ea",
}
View Source
var DlAddr = []string{
	"dl-a10b-0621.mypikpak.com",
	"dl-a10b-0622.mypikpak.com",
	"dl-a10b-0623.mypikpak.com",
	"dl-a10b-0624.mypikpak.com",
	"dl-a10b-0625.mypikpak.com",
	"dl-a10b-0858.mypikpak.com",
	"dl-a10b-0859.mypikpak.com",
	"dl-a10b-0860.mypikpak.com",
	"dl-a10b-0861.mypikpak.com",
	"dl-a10b-0862.mypikpak.com",
	"dl-a10b-0863.mypikpak.com",
	"dl-a10b-0864.mypikpak.com",
	"dl-a10b-0865.mypikpak.com",
	"dl-a10b-0866.mypikpak.com",
	"dl-a10b-0867.mypikpak.com",
	"dl-a10b-0868.mypikpak.com",
	"dl-a10b-0869.mypikpak.com",
	"dl-a10b-0870.mypikpak.com",
	"dl-a10b-0871.mypikpak.com",
	"dl-a10b-0872.mypikpak.com",
	"dl-a10b-0873.mypikpak.com",
	"dl-a10b-0874.mypikpak.com",
	"dl-a10b-0875.mypikpak.com",
	"dl-a10b-0876.mypikpak.com",
	"dl-a10b-0877.mypikpak.com",
	"dl-a10b-0878.mypikpak.com",
	"dl-a10b-0879.mypikpak.com",
	"dl-a10b-0880.mypikpak.com",
	"dl-a10b-0881.mypikpak.com",
	"dl-a10b-0882.mypikpak.com",
	"dl-a10b-0883.mypikpak.com",
	"dl-a10b-0884.mypikpak.com",
	"dl-a10b-0885.mypikpak.com",
	"dl-a10b-0886.mypikpak.com",
	"dl-a10b-0887.mypikpak.com",
}
View Source
var PCAlgorithms = []string{
	"KHBJ07an7ROXDoK7Db",
	"G6n399rSWkl7WcQmw5rpQInurc1DkLmLJqE",
	"JZD1A3M4x+jBFN62hkr7VDhkkZxb9g3rWqRZqFAAb",
	"fQnw/AmSlbbI91Ik15gpddGgyU7U",
	"/Dv9JdPYSj3sHiWjouR95NTQff",
	"yGx2zuTjbWENZqecNI+edrQgqmZKP",
	"ljrbSzdHLwbqcRn",
	"lSHAsqCkGDGxQqqwrVu",
	"TsWXI81fD1",
	"vk7hBjawK/rOSrSWajtbMk95nfgf3",
}
View Source
var WebAlgorithms = []string{
	"C9qPpZLN8ucRTaTiUMWYS9cQvWOE",
	"+r6CQVxjzJV6LCV",
	"F",
	"pFJRC",
	"9WXYIDGrwTCz2OiVlgZa90qpECPD6olt",
	"/750aCr4lm/Sly/c",
	"RB+DT/gZCrbV",
	"",
	"CyLsf7hdkIRxRm215hl",
	"7xHvLi2tOYP0Y92b",
	"ZGTXXxu8E/MIWaEDB+Sm/",
	"1UI3",
	"E7fP5Pfijd+7K+t6Tg/NhuLq0eEUVChpJSkrKxpO",
	"ihtqpG6FMt65+Xk+tWUH2",
	"NhXXU9rg4XXdzo7u5o",
}

Functions

func BuildCustomUserAgent added in v3.37.0

func BuildCustomUserAgent(deviceID, clientID, appName, sdkVersion, clientVersion, packageName, userID string) string

func GetAction added in v3.37.0

func GetAction(method string, url string) string

Types

type Addition

type Addition struct {
	driver.RootID
	ShareId                 string `json:"share_id" required:"true"`
	SharePwd                string `json:"share_pwd"`
	Platform                string `json:"platform" required:"true" type:"select" options:"android,web,pc"`
	DeviceID                string `json:"device_id"  required:"false" default:""`
	UseTransCodingAddress   bool   `json:"use_transcoding_address" required:"true" default:"false"`
	UseLowLatencyAddress    bool   `json:"use_low_latency_address" default:"false"`
	CustomLowLatencyAddress string `json:"custom_low_latency_address" default:""`
}

type AddressLatency added in v3.37.0

type AddressLatency struct {
	Address string
	Latency time.Duration
}

type CaptchaTokenRequest added in v3.37.0

type CaptchaTokenRequest struct {
	Action       string            `json:"action"`
	CaptchaToken string            `json:"captcha_token"`
	ClientID     string            `json:"client_id"`
	DeviceID     string            `json:"device_id"`
	Meta         map[string]string `json:"meta"`
	RedirectUri  string            `json:"redirect_uri"`
}

type CaptchaTokenResponse added in v3.37.0

type CaptchaTokenResponse struct {
	CaptchaToken string `json:"captcha_token"`
	ExpiresIn    int64  `json:"expires_in"`
	Url          string `json:"url"`
}

type Common added in v3.37.0

type Common struct {
	CaptchaToken string
	// 必要值,签名相关
	ClientID      string
	ClientSecret  string
	ClientVersion string
	PackageName   string
	Algorithms    []string
	DeviceID      string
	UserAgent     string
	// 验证码token刷新成功回调
	RefreshCTokenCk func(token string)
	LowLatencyAddr  string
	// contains filtered or unexported fields
}

func (*Common) GetCaptchaSign added in v3.37.0

func (c *Common) GetCaptchaSign() (timestamp, sign string)

GetCaptchaSign 获取验证码签名

func (*Common) GetCaptchaToken added in v3.37.0

func (c *Common) GetCaptchaToken() string

func (*Common) GetClientID added in v3.37.0

func (c *Common) GetClientID() string

func (*Common) GetDeviceID added in v3.37.0

func (c *Common) GetDeviceID() string

func (*Common) GetUserAgent added in v3.37.0

func (c *Common) GetUserAgent() string

func (*Common) SetCaptchaToken added in v3.37.0

func (c *Common) SetCaptchaToken(captchaToken string)

func (*Common) SetDeviceID added in v3.37.0

func (c *Common) SetDeviceID(deviceID string)

func (*Common) SetUserAgent added in v3.37.0

func (c *Common) SetUserAgent(userAgent string)

type ErrResp added in v3.37.0

type ErrResp struct {
	ErrorCode        int64  `json:"error_code"`
	ErrorMsg         string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

func (*ErrResp) Error added in v3.37.0

func (e *ErrResp) Error() string

func (*ErrResp) IsError added in v3.37.0

func (e *ErrResp) IsError() bool

type File

type File struct {
	Id             string    `json:"id"`
	ShareId        string    `json:"share_id"`
	Kind           string    `json:"kind"`
	Name           string    `json:"name"`
	ModifiedTime   time.Time `json:"modified_time"`
	Size           string    `json:"size"`
	ThumbnailLink  string    `json:"thumbnail_link"`
	WebContentLink string    `json:"web_content_link"`
	Medias         []Media   `json:"medias"`
}

type Media

type Media struct {
	MediaId   string `json:"media_id"`
	MediaName string `json:"media_name"`
	Video     struct {
		Height     int    `json:"height"`
		Width      int    `json:"width"`
		Duration   int    `json:"duration"`
		BitRate    int    `json:"bit_rate"`
		FrameRate  int    `json:"frame_rate"`
		VideoCodec string `json:"video_codec"`
		AudioCodec string `json:"audio_codec"`
		VideoType  string `json:"video_type"`
	} `json:"video"`
	Link struct {
		Url    string    `json:"url"`
		Token  string    `json:"token"`
		Expire time.Time `json:"expire"`
	} `json:"link"`
	NeedMoreQuota  bool          `json:"need_more_quota"`
	VipTypes       []interface{} `json:"vip_types"`
	RedirectLink   string        `json:"redirect_link"`
	IconLink       string        `json:"icon_link"`
	IsDefault      bool          `json:"is_default"`
	Priority       int           `json:"priority"`
	IsOrigin       bool          `json:"is_origin"`
	ResolutionName string        `json:"resolution_name"`
	IsVisible      bool          `json:"is_visible"`
	Category       string        `json:"category"`
}

type PikPakShare

type PikPakShare struct {
	model.Storage
	Addition
	*Common
	PassCodeToken string
}

func (*PikPakShare) Config

func (d *PikPakShare) Config() driver.Config

func (*PikPakShare) Drop

func (d *PikPakShare) Drop(ctx context.Context) error

func (*PikPakShare) GetAddition

func (d *PikPakShare) GetAddition() driver.Additional

func (*PikPakShare) Init

func (d *PikPakShare) Init(ctx context.Context) error
func (d *PikPakShare) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*PikPakShare) List

func (d *PikPakShare) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*PikPakShare) RefreshCaptchaToken added in v3.37.0

func (d *PikPakShare) RefreshCaptchaToken(action, userID string) error

RefreshCaptchaToken 刷新验证码token

type ShareResp

type ShareResp struct {
	ShareStatus     string `json:"share_status"`
	ShareStatusText string `json:"share_status_text"`
	FileInfo        File   `json:"file_info"`
	Files           []File `json:"files"`
	NextPageToken   string `json:"next_page_token"`
	PassCodeToken   string `json:"pass_code_token"`
}

Jump to

Keyboard shortcuts

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