Documentation ¶
Index ¶
- Constants
- Variables
- func DS1() string
- func DS2(q *resty.Request) string
- func Exec[T any](r *resty.Request, method, url string, args ...any) (t T, _ error)
- func GetAigisData(err error) (string, *geetest.V3Param)
- func IsRetCode(err error, rc int) bool
- func RSAEncrypt(content string) string
- type Aigis
- type Client
- func (c *Client) CollectPost(postId string, cancel bool) error
- func (c *Client) CreateVerification() (*geetest.V3Param, error)
- func (c *Client) GetBusinesses() (*GetBusinessesData, error)
- func (c *Client) GetCTokenBySToken() (*GetCTokenBySTokenData, error)
- func (c *Client) GetHome(gameId string) (*GetHomeData, error)
- func (c *Client) GetLTokenBySToken() (*GetLTokenBySTokenData, error)
- func (c *Client) GetPost(postId string) (*GetPostData, error)
- func (c *Client) GetSignForum(gameId string) (*GetSignForumData, error)
- func (c *Client) GetSignGame(gameName, actId, region, uid string) (*GetSignGameData, error)
- func (c *Client) GetUser(uid string) (*GetUserData, error)
- func (c *Client) ListFeedPost(gameId string) (*ListPostData, error)
- func (c *Client) ListGameRole(gameBiz string) (*ListGameRoleData, error)
- func (c *Client) ListPost(forumId, lastId string) (*ListPostData, error)
- func (c *Client) ListSignGame(gameName, actId string) (*ListSignGameData, error)
- func (c *Client) ListSignGameAward(gameName, actId, region, uid string) (list SignGameAwards, _ error)
- func (c *Client) ListSignGameAwardPage(gameName, actId, region, uid string, page, pageSize int) (list SignGameAwards, _ error)
- func (c *Client) LoginByPhoneCode(code string) (*LoginByPhoneCodeData, error)
- func (c *Client) R() *resty.Request
- func (c *Client) SendPhoneCode(aigis string) (*SendPhoneCodeData, error)
- func (c *Client) SharePost(postId string) (*SharePostData, error)
- func (c *Client) SignForum(gameId string, gt *geetest.V3Data) (*SignForumData, error)
- func (c *Client) SignGame(gameName, actId, region, uid string, gt *geetest.V3Data) (*SignGameData, error)
- func (c *Client) UpvotePost(postId string, cancel bool) error
- func (c *Client) VerifyVerification(challenge, validate string) (*VerifyVerificationData, error)
- type GameRole
- type GetBusinessesData
- type GetCTokenBySTokenData
- type GetHomeData
- type GetLTokenBySTokenData
- type GetPostData
- type GetSignForumData
- type GetSignGameData
- type GetUserData
- type HomeNav
- type ListGameRoleData
- type ListPostData
- type ListSignGameAwardData
- type ListSignGameData
- type LoginByPhoneCodeData
- type LoginUserInfo
- type PostData
- type PostInfo
- type PostSelfOperation
- type PostStat
- type PostUser
- type SendPhoneCodeData
- type SharePostData
- type SignDS
- type SignForumData
- type SignGameAward
- type SignGameAwards
- type SignGameData
- type SignGameExtraAward
- type TokenInfo
- type UserInfo
- type VerifyVerificationData
Constants ¶
View Source
const ( // AppSaltK2 https://blog.starudream.cn/2023/11/09/miyoushe-salt-2.62.2/ AppSaltK2 = "WGtruoQrwczmsjLOPXzJLnaAYycsLavx" // 2.73.1 // AppSalt6X https://github.com/UIGF-org/mihoyo-api-collect/issues/1 AppSalt6X = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v" )
View Source
const ( AddrPassport = "https://passport-api.mihoyo.com" AddrHK4E = "https://hk4e-sdk.mihoyo.com" AddrTakumi = "https://api-takumi.mihoyo.com" AddrTakumiRecord = "https://api-takumi-record.mihoyo.com" AddrActNap = "https://act-nap-api.mihoyo.com" AddrBBS = "https://bbs-api.miyoushe.com" RefererApp = "https://app.mihoyo.com" RefererAct = "https://act.mihoyo.com" AppVersion = "2.73.1" AppIdMiyoushe = "bll8iq97cem8" // 米游社 UserAgent = "Mozilla/5.0 (Linux; Android 13; 22011211C Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/104.0.5112.97 Mobile Safari/537.36 miHoYoBBS/" + AppVersion GameIdBH3 = "1" // 崩坏3 GameIdYS = "2" // 原神 GameIdBH2 = "3" // 崩坏学园2 GameIdWD = "4" // 未定事件簿 GameIdDBY = "5" // 大别野 GameIdSR = "6" // 崩坏:星穹铁道 GameIdZZZ = "8" // 绝区零 GameNameBH3 = "bh3" GameNameYS = "hk4e" GameNameBH2 = "bh2" GameNameWD = "nxx" GameNameSR = "hkrpg" GameNameZZZ = "nap" GameBizBH3CN = GameNameBH3 + "_" + cn GameBizYSCN = GameNameYS + "_" + cn GameBizBH2CN = GameNameBH2 + "_" + cn GameBizWDCN = GameNameWD + "_" + cn GameBizSRCN = GameNameSR + "_" + cn GameBizZZZCN = GameNameZZZ + "_" + cn ForumIdSR = "53" )
View Source
const ( RetCodeSendPhoneNeedGeetest = -3101 // 发送验证码需要验证码 RetCodeGameHasSigned = -5003 // 已签到 RetCodeForumHasSigned = 1008 // 打卡失败或重复打卡 RetCodeForumNeedGeetest = 1034 // 需要验证码 )
Variables ¶
View Source
var ( GameIdByName = map[string]string{ GameNameBH3: GameIdBH3, GameNameYS: GameIdYS, GameNameSR: GameIdSR, GameNameZZZ: GameIdZZZ, } GameIdByBiz = map[string]string{ GameBizBH3CN: GameIdBH3, GameBizYSCN: GameIdYS, GameBizBH2CN: GameIdBH2, GameBizWDCN: GameIdWD, GameBizSRCN: GameIdSR, GameBizZZZCN: GameIdZZZ, } GameCNNameById = map[string]string{ GameIdBH3: "崩坏3", GameIdYS: "原神", GameIdSR: "崩坏:星穹铁道", GameIdZZZ: "绝区零", } )
Functions ¶
func RSAEncrypt ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetBusinesses ¶
func (c *Client) GetBusinesses() (*GetBusinessesData, error)
func (*Client) GetCTokenBySToken ¶
func (c *Client) GetCTokenBySToken() (*GetCTokenBySTokenData, error)
GetCTokenBySToken get cookie token by stoken v2 https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/user/token.md#%E9%80%9A%E8%BF%87stoken%E8%8E%B7%E5%8F%96cookie-token
func (*Client) GetLTokenBySToken ¶
func (c *Client) GetLTokenBySToken() (*GetLTokenBySTokenData, error)
GetLTokenBySToken get ltoken v1 by stoken v2 https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/user/token.md#%E9%80%9A%E8%BF%87stoken%E8%8E%B7%E5%8F%96ltokenv1
func (*Client) GetSignForum ¶
func (c *Client) GetSignForum(gameId string) (*GetSignForumData, error)
func (*Client) GetSignGame ¶
func (c *Client) GetSignGame(gameName, actId, region, uid string) (*GetSignGameData, error)
func (*Client) ListFeedPost ¶
func (c *Client) ListFeedPost(gameId string) (*ListPostData, error)
func (*Client) ListGameRole ¶
func (c *Client) ListGameRole(gameBiz string) (*ListGameRoleData, error)
func (*Client) ListSignGame ¶
func (c *Client) ListSignGame(gameName, actId string) (*ListSignGameData, error)
func (*Client) ListSignGameAward ¶
func (c *Client) ListSignGameAward(gameName, actId, region, uid string) (list SignGameAwards, _ error)
func (*Client) ListSignGameAwardPage ¶
func (c *Client) ListSignGameAwardPage(gameName, actId, region, uid string, page, pageSize int) (list SignGameAwards, _ error)
func (*Client) LoginByPhoneCode ¶
func (c *Client) LoginByPhoneCode(code string) (*LoginByPhoneCodeData, error)
func (*Client) SendPhoneCode ¶
func (c *Client) SendPhoneCode(aigis string) (*SendPhoneCodeData, error)
func (*Client) VerifyVerification ¶
func (c *Client) VerifyVerification(challenge, validate string) (*VerifyVerificationData, error)
type GetBusinessesData ¶
type GetBusinessesData struct {
Businesses []string `json:"businesses"`
}
type GetCTokenBySTokenData ¶
type GetHomeData ¶
type GetHomeData struct {
}func (*GetHomeData) GetSignActId ¶
func (t *GetHomeData) GetSignActId() string
type GetLTokenBySTokenData ¶
type GetLTokenBySTokenData struct {
LToken string `json:"ltoken"`
}
type GetPostData ¶
type GetPostData struct {
Post *PostData `json:"post"`
}
type GetSignForumData ¶
type GetSignForumData struct {
IsSigned bool `json:"is_signed"`
}
type GetSignGameData ¶
type GetUserData ¶
type GetUserData struct {
UserInfo *UserInfo `json:"user_info"`
}
type ListGameRoleData ¶
type ListGameRoleData struct {
List []*GameRole `json:"list"`
}
type ListPostData ¶
type ListSignGameAwardData ¶
type ListSignGameAwardData struct { Total int `json:"total"` List SignGameAwards `json:"list"` }
func (*ListSignGameAwardData) GetList ¶
func (t *ListSignGameAwardData) GetList() SignGameAwards
type ListSignGameData ¶
type ListSignGameData struct { Month int `json:"month"` Biz string `json:"biz"` Resign bool `json:"resign"` Awards []*SignGameAward `json:"awards"` ExtraAward *SignGameExtraAward `json:"short_extra_award"` }
type LoginByPhoneCodeData ¶
type LoginByPhoneCodeData struct { Token *TokenInfo `json:"token"` UserInfo *LoginUserInfo `json:"user_info"` }
type LoginUserInfo ¶
type PostData ¶
type PostData struct { Post *PostInfo `json:"post"` Stat *PostStat `json:"stat"` User *PostUser `json:"user"` SelfOperation *PostSelfOperation `json:"self_operation"` }
func (*PostData) IsCollected ¶
type PostSelfOperation ¶
type SendPhoneCodeData ¶
type SharePostData ¶
type SharePostData struct {}
type SignForumData ¶
type SignForumData struct {
Points int `json:"points"`
}
type SignGameAward ¶
type SignGameAwards ¶
type SignGameAwards []*SignGameAward
func (SignGameAwards) ShortString ¶
func (v1 SignGameAwards) ShortString() string
func (SignGameAwards) Today ¶
func (v1 SignGameAwards) Today() (v2 SignGameAwards)
type SignGameData ¶
type SignGameData struct { Code string `json:"code"` Success int `json:"success"` IsRisk bool `json:"is_risk"` RiskCode int `json:"risk_code"` Gt string `json:"gt"` Challenge string `json:"challenge"` }
func (*SignGameData) IsRisky ¶
func (t *SignGameData) IsRisky() bool
type SignGameExtraAward ¶
type VerifyVerificationData ¶
type VerifyVerificationData struct {
Challenge string `json:"challenge"`
}
Click to show internal directories.
Click to hide internal directories.