Documentation ¶
Index ¶
- Constants
- func GetFileInfo(path string) (os.FileInfo, error)
- type BuyParam
- type ChannelList
- type Client
- func (c *Client) BuyProduct(param *BuyParam) (*CommonResult, error)
- func (c *Client) Comment(param CommentParam) (*CommentResult, error)
- func (c *Client) CreateArticle(param CreateArticleParam) (uint64, error)
- func (c *Client) DeleteComment(param CommentParam) (*CommonResult, error)
- func (c *Client) GetChannelList(ChannelType uint8) ([]ChannelList, error)
- func (c *Client) GetContributeList(param GetUserContributeListParam) (*ContributeListResult, error)
- func (c *Client) GetCookies() []*http.Cookie
- func (c *Client) GetCookiesString() string
- func (c *Client) GetOrderList(pageNo, pageSize int) (*OrderList, error)
- func (c *Client) GetPersonalInfo(uid ...uint64) (*UserInfo, error)
- func (c *Client) GetProductList(pageNo, pageSize int) (*ProductListResult, error)
- func (c *Client) GetQRCode() (*QRCode, error)
- func (c *Client) GetUID() uint64
- func (c *Client) LoginWithPassword(param LoginWithPasswordParam) (*LoginWithPasswordResult, error)
- func (c *Client) LoginWithQRCode(QRinfo QRCode) error
- func (c *Client) Resty() *resty.Client
- func (c *Client) SetCookies(cookies []*http.Cookie)
- func (c *Client) SetCookiesString(cookiesString string)
- func (c *Client) SetRawCookies(rawCookies string)
- func (c *Client) ThrowBanana(param ThrowBananaParam) (uint8, error)
- func (c *Client) UploadPic(picPath string) (string, error)
- type CommentParam
- type CommentResult
- type CommonResult
- type Contribute
- type ContributeListResult
- type CreateArticleParam
- type GetUserContributeListParam
- type LoginWithPasswordParam
- type LoginWithPasswordResult
- type Order
- type OrderList
- type Product
- type ProductListResult
- type QRCode
- type Tag
- type ThrowBananaParam
- type UploadPart
- type UserInfo
Constants ¶
View Source
const (
QRURL = "https://scan.acfun.cn/rest/pc-direct/qr/"
)
View Source
const (
UploadEndpoint = "https://mediacloud.kuaishou.com/api/upload/fragment"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuyParam ¶
type BuyParam struct { // 对应上面的产品 ID ProductId uint64 `request:"query"` Count uint16 `request:"query,default=1"` // 1香蕉,2金香蕉 除了AC药丸都是金香蕉了 PayType uint8 `request:"query,default=2"` // 收货人姓名 Name string `request:"query"` //手机号码 Tel string `request:"query"` // 地址 Address string `request:"query"` // 备注 Remark string `request:"query"` }
type ChannelList ¶
type ChannelList struct { Children []struct { // 视频 type 2返回没 Realms 字段 Realms []struct { Introduction string `json:"introduction"` RealmID string `json:"realmId"` RealmName string `json:"realmName"` } `json:"realms"` ChannelID string `json:"channelId"` ChannelType uint8 `json:"channelType"` Name string `json:"name"` } `json:"children"` ChannelID string `json:"channelId"` ChannelType uint8 `json:"channelType"` Name string `json:"name"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithClient ¶
func (*Client) BuyProduct ¶
func (c *Client) BuyProduct(param *BuyParam) (*CommonResult, error)
func (*Client) Comment ¶
func (c *Client) Comment(param CommentParam) (*CommentResult, error)
func (*Client) CreateArticle ¶
func (c *Client) CreateArticle(param CreateArticleParam) (uint64, error)
文章区投稿
func (*Client) DeleteComment ¶
func (c *Client) DeleteComment(param CommentParam) (*CommonResult, error)
func (*Client) GetChannelList ¶
func (c *Client) GetChannelList(ChannelType uint8) ([]ChannelList, error)
列出分区 1是文章区 2是视频 0是老文章区list
func (*Client) GetContributeList ¶
func (c *Client) GetContributeList(param GetUserContributeListParam) (*ContributeListResult, error)
查询视频和文章投稿,可指定用户,指定类型
func (*Client) GetCookiesString ¶
GetCookiesString 获取字符串格式的cookies,方便自行存储后下次使用。配合下面的 SetCookiesString 使用。
func (*Client) GetOrderList ¶
列出我的订单
func (*Client) GetPersonalInfo ¶
GetPersonalInfo获取用户信息
func (*Client) GetProductList ¶
func (c *Client) GetProductList(pageNo, pageSize int) (*ProductListResult, error)
列出香蕉商城
func (*Client) LoginWithPassword ¶
func (c *Client) LoginWithPassword(param LoginWithPasswordParam) (*LoginWithPasswordResult, error)
LoginWithPassword 账号密码登录,其中validate, seccode字段需要在极验人机验证后获取
func (*Client) LoginWithQRCode ¶
func (*Client) SetCookies ¶
SetCookies 设置cookies
func (*Client) SetCookiesString ¶
SetCookiesString 设置Cookies,但是是字符串格式,配合 GetCookiesString 使用。有些功能必须登录或设置Cookies后才能使用。
func (*Client) SetRawCookies ¶
SetRawCookies 如果你是从浏览器request的header中直接复制出来的cookies,调用这个函数。
type CommentParam ¶
type CommentParam struct { // 对应上面的产品 ID SourceId uint64 `request:"query,field=sourceId"` // 评论类型 SourceType uint8 `request:"query,field=sourceType,default=3"` // 内容,为空给删除评论参数使用 Content string `request:"query,field=content,omitempty"` // 回复指定评论 ReplyToId uint64 `request:"query,field=replyToCommentId"` }
type CommentResult ¶
type CommentResult struct { SourceID uint64 `json:"sourceId"` // HeadURL []struct { // Cdn string `json:"cdn"` // URL string `json:"url"` // URLPattern string `json:"urlPattern"` // } `json:"headUrl"` LikeCount int `json:"likeCount"` Content string `json:"content"` // Result int `json:"result"` IsUp bool `json:"isUp"` ReplyToUserName string `json:"replyToUserName"` // ImageURL interface{} `json:"imageUrl"` // AvatarFrame int `json:"avatarFrame"` SelfComment bool `json:"selfComment"` Floor uint64 `json:"floor"` // VerifiedText string `json:"verifiedText"` // Timestamp int64 `json:"timestamp"` // NameRed int `json:"nameRed"` // NameColor int `json:"nameColor"` // IsSignedUpCollege bool `json:"isSignedUpCollege"` // Verified int `json:"verified"` // IsLiked bool `json:"isLiked"` // ContentUbbVersion string `json:"contentUbbVersion"` // VerifiedType int `json:"verifiedType"` // HostName string `json:"host-name"` // UserName string `json:"userName"` // UserID int `json:"userId"` // 3一般 SourceType uint8 `json:"sourceType"` // VerifiedTypes []int `json:"verifiedTypes"` // AvatarImage string `json:"avatarImage"` ReplyTo int `json:"replyTo"` CommentID uint64 `json:"commentId"` }
type CommonResult ¶
type CommonResult struct { Result int `json:"result"` Err string `json:"error_msg"` // https://member.acfun.cn/list/api/queryContributeList 错误会返回下面俩属性 ErrMsg struct { Result int `json:"result"` ErrorMsg string `json:"error_msg"` } `json:"errMsg"` IsError bool `json:"isError"` }
快手的 result 是 1 正常 -401 "user not login"
type Contribute ¶
type Contribute struct { GroupID string `json:"groupId"` IsFollowing bool `json:"isFollowing"` // pc android SourcePlatform string `json:"sourcePlatform"` FansCount uint `json:"fansCount"` ChannelID uint `json:"channelId"` // 访问量 ViewCount uint64 `json:"viewCount"` CommentCount uint `json:"commentCount"` BananaCount uint `json:"bananaCount"` UserImg string `json:"userImg"` // 和下面 ContentID 一样 ResourceID int `json:"resourceId"` // CONTENT_ARTICLE // ResourceType string `json:"resourceType"` ChannelName string `json:"channelName"` // 稿件ID // ContentID int `json:"contentId"` TagList []Tag `json:"tagList"` // 就是 uid // AuthorID uint64 `json:"authorId"` UserID uint64 `json:"userId"` // UserHeadImgInfo struct { // Width int `json:"width"` // Height int `json:"height"` // Size int `json:"size"` // Type int `json:"type"` // Animated bool `json:"animated"` // ThumbnailImage struct { // CdnUrls []struct { // URL string `json:"url"` // FreeTrafficCdn bool `json:"freeTrafficCdn"` // } `json:"cdnUrls"` // } `json:"thumbnailImage"` // ThumbnailImageCdnURL string `json:"thumbnailImageCdnUrl"` // } `json:"userHeadImgInfo"` CommentCountTenThousandShow string `json:"commentCountTenThousandShow"` // 投稿时间,毫秒时间戳 ContributeTime uint64 `json:"contributeTime"` ContentTitle string `json:"contentTitle"` // 封面 VideoCover string `json:"videoCover"` // 用户个性签名 UserSignature string `json:"userSignature"` // 视频和文章稿件 ContributionCount uint `json:"contributionCount"` // 弹幕数量 DanmuCount uint64 `json:"danmuCount"` UserName string `json:"userName"` // 封面 CoverImgInfo struct { Width int `json:"width"` Height int `json:"height"` Size int `json:"size"` Type int `json:"type"` Animated bool `json:"animated"` ThumbnailImage struct { CdnUrls []struct { URL string `json:"url"` FreeTrafficCdn bool `json:"freeTrafficCdn"` } `json:"cdnUrls"` } `json:"thumbnailImage"` ThumbnailImageCdnURL string `json:"thumbnailImageCdnUrl"` } `json:"coverImgInfo"` ViewCountShow string `json:"viewCountShow"` DanmakuCountShow string `json:"danmakuCountShow"` BananaCountShow string `json:"bananaCountShow"` ContentType int `json:"contentType"` Status int `json:"status"` Channel struct { ParentID int `json:"parentId"` ParentName string `json:"parentName"` Name string `json:"name"` ID int `json:"id"` } `json:"channel"` }
type ContributeListResult ¶
type ContributeListResult struct { Feed []Contribute `json:"feed"` TotalNum uint `json:"totalNum"` }
type CreateArticleParam ¶
type CreateArticleParam struct { // 标题 Title string // 描述 Description string // 内容,{"bodyList":[{"orderId":1,"title":"","txt":"xxx"}]} Detail string //视频标签,最多4个 TagNames []string // 1转载 3原创 CreationType uint8 // RealmID 是 ChannelId 下的子类目,例如 生活下的 爽文/吐槽 // 频道 86生活娱乐 139音乐-综合音乐 110 综合杂谈/资讯 ChannelId string // 5 13 34 RealmID string // 封面 CoverURL string }
func (*CreateArticleParam) Body ¶
func (a *CreateArticleParam) Body() any
type GetUserContributeListParam ¶
type GetUserContributeListParam struct { // 前一页数字 Pcursor uint `json:"pcursor" request:"body,default=0"` // 2是视频 3 是文章 ResourceType uint8 `json:"resourceType" request:"body,default=3"` // https://member.acfun.cn/list/api/getSortList 带 resourceType=3 查询 // 3 最新发布,1 最多阅读, 2 最多香蕉 SortType uint8 `json:"sortType" request:"body,default=3"` AuthorId uint64 `json:"authorId" request:"body"` Keyword string `json:"keyword" request:"body"` // 1 已通过 2发布中 3已退回 Status uint8 `json:"status" request:"body,default=0"` }
type LoginWithPasswordParam ¶
type LoginWithPasswordResult ¶
type Order ¶
type Order struct { Count uint `json:"count"` Name string `json:"name"` // 订单号 ID string `json:"id"` // finish State string `json:"state"` // 1 PayType uint8 `json:"payType"` // 商品ID ProductID uint64 `json:"productId"` // 2虚拟 ProductType uint8 `json:"productType"` //Image string `json:"image"` BuyTime int64 `json:"buyTime"` // 1香蕉 666金香蕉 PayAmount string `json:"payAmount"` }
type Product ¶
type Product struct { // 数量 Amount uint64 `json:"amount"` // 销量 Sales uint64 `json:"sales"` // 1为真实需要写地址的商品, 2 为虚拟用品 Type uint8 `json:"type"` CoolDownDay int `json:"coolDownDay"` MaxAllowBuy int `json:"maxAllowBuy"` LevelLimit uint `json:"levelLimit"` Title string `json:"title"` PriceInfo []struct { // 价格 Count uint64 `json:"count"` // 金香蕉 PayTypeInfo string `json:"payTypeInfo"` // 1是香蕉,2是金香蕉 PayType uint8 `json:"payType"` } `json:"priceInfo"` //ImagePCURL string `json:"imagePCUrl"` //ImageAppURL string `json:"imageAppUrl"` //ImageURL string `json:"imageUrl"` ProductID uint64 `json:"productId"` // 过期时间 ExpireTime int64 `json:"expireTime"` // 1 Status int `json:"status"` // 描述 Description string `json:"description"` }
type ProductListResult ¶
type QRCode ¶
type QRCode struct { // 第一次 scanResult 再请求是 acceptResult succ Next string `json:"next" request:"omitempty"` ExpireTime int `json:"expireTime" request:"omitempty"` QrLoginSignature string `json:"qrLoginSignature" request:"query"` // 二维码被base64后的字符串 ImageData string `json:"imageData" request:"omitempty"` QrLoginToken string `json:"qrLoginToken" request:"query"` // SCANNED Status string `json:"status" request:"omitempty"` }
type ThrowBananaParam ¶
type UploadPart ¶
type UploadPart struct {
// contains filtered or unexported fields
}
type UserInfo ¶
type UserInfo struct { Name string `json:"userName"` Uid uint64 `json:"userId"` Level uint16 `json:"level"` Mobile string `json:"mobile"` Email string `json:"email"` Banana uint64 `json:"banana"` GoldBanana uint64 `json:"goldBanana"` // 粉丝 // Followed string `json:"followed"` FollowedNum uint64 `json:"followedNum"` // 性别,男1,未知-1 Gender int8 `json:"gender"` RegisterTime int64 `json:"registerTime"` // 稿件数量 ContentCount string `json:"contentCount"` // 关注别人数量 Following string `json:"following"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.