Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403s when creating custom games with bots #138

Open
rosenjcb opened this issue Dec 22, 2022 · 2 comments
Open

403s when creating custom games with bots #138

rosenjcb opened this issue Dec 22, 2022 · 2 comments

Comments

@rosenjcb
Copy link

When I try to create a custom correspondence game with the bot, I get a 403. No other info in the error popup.

@acristescu
Copy link
Owner

Two questions:

  • Which bot in particular?
  • Have you tried logging out and logging back in?

@rosenjcb
Copy link
Author

rosenjcb commented Jan 22, 2023

@acristescu Forgot to get back on this but:

1.) It was any bot. But I tried it out on amybot for the most part.
2.) I tried logging into a different account and same issue.

What's funny is you can start a bot game on the website and then find the corresponding game in the OnlineGo app with no issues. I'm thinking they changed the API schema for custom bots. Here's the POST request the frontend website sends when creating a new bot game. Does it look significantly different from what the mobile app requests now?

curl 'https://online-go.com/api/v1/players/605979/challenge' \
  -H 'authority: online-go.com' \
  -H 'accept: application/json, text/javascript, */*; q=0.01' \
  -H 'accept-language: en-US,en;q=0.9,he-IL;q=0.8,he;q=0.7' \
  -H 'content-type: application/json' \
  -H 'cookie: csrftoken={{SOME_COOKIE_I_TOOK_OUT}}; sessionid={{SOME_SESSION_ID_I_TOOK_OUT}}' \
  -H 'origin: https://online-go.com' \
  -H 'referer: https://online-go.com/play' \
  -H 'sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' \
  -H 'x-csrftoken: tY4xOMBIfP2uAsEN9576B847MCIWlYRz663oKRXUgef5JuChjbESRamqNm0oDPBs' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw '{"initialized":false,"min_ranking":-1000,"max_ranking":1000,"challenger_color":"automatic","rengo_auto_start":0,"game":{"name":"Friendly Match","rules":"japanese","ranked":false,"width":13,"height":13,"handicap":0,"komi_auto":"automatic","komi":null,"disable_analysis":false,"initial_state":null,"private":false,"rengo":false,"rengo_casual_mode":true,"time_control":"byoyomi","time_control_parameters":{"main_time":604800,"period_time":86400,"periods":5,"periods_min":1,"periods_max":300,"pause_on_weekends":false,"speed":"correspondence","system":"byoyomi","time_control":"byoyomi"},"pause_on_weekends":false},"aga_ranked":false}' \
  --compressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants