Documentation ¶
Index ¶
Constants ¶
View Source
const MaxLoginTimeOut = 120
View Source
const XHSLimitCount = 20
Variables ¶
View Source
var ( XhsBasUrl = "https://www.xiaohongshu.com" ApiBaseUrl = "https://edith.xiaohongshu.com" )
View Source
var XHSPageCount = 1
Functions ¶
func IntToBase36 ¶
Types ¶
type ConvertCookiesResp ¶
type ConvertCookiesResp struct {
// contains filtered or unexported fields
}
func ConvertCookies ¶
func ConvertCookies(cookies []playwright.Cookie) (ConvertCookiesResp, error)
ConvertCookies The following code is used to convert playwright cookie into a custom pattern
type NoteSearchResult ¶
type ReadNoteCore ¶
type ReadNoteCore struct {
// contains filtered or unexported fields
}
func (*ReadNoteCore) CreateXhsClient ¶
func (core *ReadNoteCore) CreateXhsClient() *XhsApiClient
func (*ReadNoteCore) InitConfig ¶
func (core *ReadNoteCore) InitConfig(loginType string)
func (*ReadNoteCore) Search ¶
func (core *ReadNoteCore) Search()
func (*ReadNoteCore) Start ¶
func (core *ReadNoteCore) Start()
type SampleCookie ¶
type SearchSortType ¶
type SearchSortType string
const ( GENERAL SearchSortType = "general" POPULAR SearchSortType = "popularity_descending" LATEST SearchSortType = "time_descending" )
type SearchXhsNoteParams ¶
type SearchXhsNoteParams struct { Keyword string `json:"keyword"` Page int `json:"page"` PageSize int `json:"page_size"` Sort SearchSortType `json:"sort"` NoteType SearchNoteType `json:"note_type"` SearchId string `json:"search_id"` }
type XhsApiClient ¶
type XhsApiClient struct {
// contains filtered or unexported fields
}
XhsApiClient Packaged api client based on xhs
func (*XhsApiClient) GetNoteByKeyword ¶
func (api *XhsApiClient) GetNoteByKeyword(searchParams SearchXhsNoteParams) (NoteSearchResult, error)
GetNoteByKeyword get note list by search keywords
func (*XhsApiClient) Ping ¶
func (api *XhsApiClient) Ping() bool
Ping xhs api pong before execute search note ...
func (*XhsApiClient) UpdateCookies ¶
func (api *XhsApiClient) UpdateCookies(ctx playwright.BrowserContext)
UpdateCookies will call this method when invalid login
type XhsHttpClient ¶
type XhsHttpClient struct {
// contains filtered or unexported fields
}
XhsHttpClient Packaged httpclient based on xhs
func (*XhsHttpClient) PreHeaders ¶
func (c *XhsHttpClient) PreHeaders(uri string, body []byte) map[string]interface{}
type XhsLogin ¶
type XhsLogin struct {
// contains filtered or unexported fields
}
func (*XhsLogin) CheckLoginState ¶
CheckLoginState polling check login state
func (*XhsLogin) LoginByCookies ¶
func (xl *XhsLogin) LoginByCookies()
LoginByCookies login use cookies
func (*XhsLogin) LoginByQrcode ¶
func (xl *XhsLogin) LoginByQrcode()
LoginByQrcode login by scan qrcode image
Click to show internal directories.
Click to hide internal directories.