0xzer / messagix

A Go library to interact with the Instagram/Facebook API
MIT License
12 stars 2 forks source link

messagix-configs: failed to setup configs (&{%!e(string=failed to sync data via graphql for databases: 1, 2, 95: &{%!e(string=failed to unmarshal LSRequest response bytes into LSPlatformGraphQLLightspeedRequestForIGDQuery struct: &{%!e(string=invalid character '<' looking for beginning of value) %!e(int64=1)})})}) #2

Open wind-hx opened 8 months ago

wind-hx commented 8 months ago

Initialize the instagram client through cookies

cookieStr := `{"SessionId":"65151172087%3AIgX5hHg6Wd24QA%3A15%3AAYebn4DASjy8T_9IfCl7HAtJ-GnrOLI6h7pzSARh9Q","CsrfToken":"dNTzXnXR6QEI7j55wXlr3HElzcDaJGPG","MachineId":"ZeV90AAEAAED2knVkosrmZcV6FBd","IgDeviceId":"1A27CCA4-48C6-42B0-9E81-0C82D07424D8","Rur":"\"NAO\\05465151172087\\0541741074774:01f78e59c4a33e2b426d7f8c153aa0910f093f96b13fda676a9e6fa2dfb3abbd4be895dd\"","UserId":"65151172087","IgWWWClaim":"hmac.AR1eM9bzjmDqN6SeGKsFweksfrROuqSbSYmMzgWkzkYBx_GF"}`
    cookie, err := cookies.NewCookiesFromJson(cookieStr, types.Instagram)
    if err != nil {
        log.Println(err)
    }
    cli, err := messagix.NewClient(types.Instagram, cookie, debug.NewLogger(), "")
    if err != nil {
        log.Println(err)
    }

    cli.Connect()
    account, _ := cli.GetCurrentAccount()

    log.Println(account)