lishogi icon indicating copy to clipboard operation
lishogi copied to clipboard

Import JSON game record

Open ddugovic opened this issue 2 years ago • 1 comments

shogi-utils can download 81Dojo games in JSON format (from an undocumented API). Long-term I would like to be able to index games by opening (right now to do that I would need to create studies per opening and manually import games into the correct studies):

{"id":4735115,"black_id":26905,"white_id":89699,"contents":"V2\nN+Toadofsky\nN-yattan71\nTo_Move:+\n$EVENT:EARTH+nr_Toadofsky-600-30+Toadofsky+yattan71+20200626125026\nI+1249,840,x2|81WS\nI-*1154,392,x2|ADR\n$START_TIME:2020/06/26 12:50:26\nP1-KY-KE-GI-KI-OU-KI-GI-KE-KY\nP2 * -HI *  *  *  *  * -KA * \nP3-FU-FU-FU-FU-FU-FU-FU-FU-FU\nP4 *  *  *  *  *  *  *  *  * \nP5 *  *  *  *  *  *  *  *  * \nP6 *  *  *  *  *  *  *  *  * \nP7+FU+FU+FU+FU+FU+FU+FU+FU+FU\nP8 * +KA *  *  *  *  * +HI * \nP9+KY+KE+GI+KI+OU+KI+GI+KE+KY\n+\n'rating:Toadofsky:yattan71\n+7776FU\nT6\n-3334FU\nT27\n+6766FU\nT4\n-8242HI\nT5\n+2868HI\nT4\n-2233KA\nT9\n+5948OU\nT5\n-4222HI\nT1\n+6665FU\nT20\n-5162OU\nT31\n+6564FU\nT2\n-6364FU\nT9\n+6864HI\nT10\n-0054FU\nT2\n'ILLEGAL_MOVE(-0054FU)\n#ILLEGAL_MOVE\n#SENTE_WIN\n'P1-KY-KE-GI-KI * -KI-GI-KE-KY\n'P2 *  *  * -OU *  *  * -HI * \n'P3-FU-FU-FU * -FU-FU-KA-FU-FU\n'P4 *  *  * +HI *  * -FU *  * \n'P5 *  *  *  *  *  *  *  *  * \n'P6 *  * +FU *  *  *  *  *  * \n'P7+FU+FU *  * +FU+FU+FU+FU+FU\n'P8 * +KA *  *  * +OU *  *  * \n'P9+KY+KE+GI+KI * +KI+GI+KE+KY\n'P+00FU\n'P-00FU\n'-\n'summary:illegal move:Toadofsky win:yattan71 lose:14:*:1249,840,0:*1154,392,0\n'$END_TIME:2020/06/26 12:52:50\n","tournament_id":null,"tournament_name":null,"gametype":"nr","server_id":3,"totaltime":600,"byoyomi":30,"blackrate":1249,"whiterate":-1154,"result":1,"endtype":"#ILLEGAL_MOVE","opening_id":null,"created_at":"2020-06-26T03:50:26.000Z","updated_at":"2020-06-26T03:50:26.000Z"}

The move list for https://system.81dojo.com/en/kifus/4735115 :

  1. P-76 2. P-34 3. P-66 4. R-42 5. R-68 6. B-33 7. K-48 8. R-22 9. P-65 10. K-62 11. P-64 12. Px64 13. Rx64 14. P'54 15. Illegal move (P'54)

corresponds to this element: +7776FU\nT6\n-3334FU\nT27\n+6766FU\nT4\n-8242HI\nT5\n+2868HI\nT4\n-2233KA\nT9\n+5948OU\nT5\n-4222HI\nT1\n+6665FU\nT20\n-5162OU\nT31\n+6564FU\nT2\n-6364FU\nT9\n+6864HI\nT10\n-0054FU\nT2\n'ILLEGAL_MOVE(-0054FU)\n#ILLEGAL_MOVE\n#SENTE_WIN\n'

ddugovic avatar Apr 07 '22 12:04 ddugovic