Code Monkey home page Code Monkey logo

s3si.ts's Introduction

s3si.ts

Build status Constant check status

Export your battles from SplatNet to stat.ink and Splashcat.

If you have used s3s, please see here.

Usage

  1. Install deno

  2. Run deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts [options]

Options:
    --profile-path <path>, -p    Path to config file (default: ./profile.json)
    --exporter <exporter>, -e    Exporter list to use (default: stat.ink)
                                 Multiple exporters can be separated by commas
                                 (e.g. "stat.ink,file,splashcat")
    --list-method                When set to "latest", the latest 50 matches will be obtained.
                                 When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
                                 When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
                                 "auto" is the default setting.
    --no-progress, -n            Disable progress bar
    --monitor, -m                Monitor mode
    --skip-mode <mode>, -s       Skip mode (default: null)
                                 ("vs", "coop")
    --with-summary               Include summary in the output
    --help                       Show this help message and exit
    --nxapi-presence             Extends monitoring mode to use Nintendo Switch presence from nxapi
  1. If it's your first time running this, follow the instructions to login to Nintendo Account. Your token will be saved to profile.json for future use.
  • If you want to use a different profile, use -p to specify the path to the profile file.

Splashcat Notes

Due to limitations with SplatNet 3 data, Splashcat requires battles uploaded to use en-US (set with userLang). Splashcat will localize most parts of battle results into the user's language when displayed.

Track your rank

  • Run deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/initRank.ts to initialize your rank data. (You can also use -p to specify the path to the profile file.)

  • Then enter your current rank and rank point. For example: S+0,300. And the rank will be saved in the profile.json.

  • After that, run s3si.ts, the rank point will be reported to stat.ink.

profile.json

{
  // cacheDir is the directory to store cache files
  "cacheDir": "./cache",
  // don't change this if you don't know what it is
  "fGen": "https://api.imink.app/f",
  // if you run with -e file, this is the directory to store exported files
  "fileExportPath": "./export",
  // the interval to check for new battles in monitor mode
  "monitorInterval": 500,
  // login token
  "loginState": {
    "sessionToken": "...",
    "gToken": "...",
    "bulletToken": "..."
  },
  // userLang will effect the language of the exported games to stat.ink
  "userLang": "zh-CN",
  "userCountry": "JP",
  "statInkApiKey": "...",
  "splashcatApiKey": "..."
}

Migrate from s3s

If you have used s3s before, you can migrate your data to s3si.ts by creating a profile.json file with the following contents:

{
  "loginState": {
    "sessionToken": "<session_token in your s3s' config.txt>"
  },
  "statInkApiKey": "<your stat.ink API key>"
}

Then run s3si.ts, and it will work without login prompt.

Credits

s3si.ts's People

Contributors

catgirlinspace avatar cypas avatar hasefumi23 avatar kesin11 avatar laxect avatar paul-sama avatar spacemeowx2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

s3si.ts's Issues

[feature request] collect general player data/stats for external usage

First, thanks a lot for this awesome tool !
I really like how it's straightforward to use and the fact it's written for deno 😄

I know this tool is mostly intended to export match data to stat.ink, but do you think it could be possible to also provide additional CLI options to fetch other data for the file exporter ?

I'm mostly thinking about weapons stats and badges, but I guess festivals teams or favorites gears could be cool too.
Some sections on the splatnet app offer a lot of data and it'd be nice to be able to use them:

Context:

I'm currently using s3si.ts output to render SVG badges of last played matches through GitHub Actions (see example below, may be a bit buggy on mobile though), and the aim would be to display more general data to make some kind of player card 😄

New way to regenerate tokens

Now it request Home query at launch to test if the token works. I'd like to remove this step, and regenerate tokens when API request fails.

APIError: No idToken2 found

APIError: No idToken2 found
Response:  Response {
  body: ReadableStream { locked: true },
  bodyUsed: true,
  headers: Headers {
  allow: "POST, OPTIONS",
  "content-type": "application/json",
  date: "Tue, 06 Dec 2022 04:03:19 GMT",
  "referrer-policy": "same-origin",
  server: "gunicorn",
  vary: "Accept-Encoding, Origin",
  via: "1.1 google",
  "x-content-type-options": "nosniff",
  "x-frame-options": "DENY"
},
  ok: true,
  redirected: false,
  status: 200,
  statusText: "OK",
  url: "https://api-lp1.znc.srv.nintendo.net/v3/Account/Login"
}
Body:  { status: 9400, errorMessage: "Bad request.", correlationId: "..." }

To Reproduce

Just run the script.

Environment (please complete the following information):

  • Linux 6.0.10-arch2-1
  • deno 1.28.3 (release, x86_64-unknown-linux-gnu)
  • Commit e49706c

Schema changed

Splatnet3 has a breaking change in GraphQL schema. So the APQ's sha256 may be changed. Although there is no change in the app yet.

{
  "errors": [
    {
      "message": "Field 'id' doesn't exist on type 'CoopSupplySpecialWeapon'",
      "locations": [
        {
          "line": 149,
          "column": 5
        }
      ],
      "path": [
        "fragment PlayerModal_coopPlayerResult",
        "specialWeapon",
        "id"
      ],
      "extensions": {
        "code": "undefinedField",
        "typeName": "CoopSupplySpecialWeapon",
        "fieldName": "id"
      }
    },
    {
      "message": "Field 'id' doesn't exist on type 'CoopSupplySpecialWeapon'",
      "locations": [
        {
          "line": 179,
          "column": 5
        }
      ],
      "path": [
        "fragment PlayerResult_coopPlayerResult",
        "specialWeapon",
        "id"
      ],
      "extensions": {
        "code": "undefinedField",
        "typeName": "CoopSupplySpecialWeapon",
        "fieldName": "id"
      }
    }
  ]
}

Duplicate uploads of Salmon Run jobs previously uploaded by s3s

Describe the bug
I've been running s3s for the past few weeks, and wanted to give s3si.ts a go for its rank tracking. After starting the docker container, I noticed it started trying to upload 50 salmon run jobs, and after stopping it and checking one, I had noticed that it was uploading duplicates of jobs s3s had uploaded.

This can be observed on my stat.ink profile here

Interestingly, those uploaded by s3si.ts also seem to be missing the rank before (showing ? -> whatever rank whereas s3s shows the data, possibly related to the below error?), and are missing the weapon list on the Salmon Log page, but not in the full details page.

At some point, I also started getting spam of the following error:

Body:  { error: { title_exp_before: "Title Exp Before must be no less than 0." } }
Failed to export to stat.ink: Error: Failed to export battle
    at StatInkAPI.postCoop (file:///app/src/exporters/stat.ink.ts:136:13)
    at async StatInkExporter.exportGame (file:///app/src/exporters/stat.ink.ts:294:23)
    at async step (file:///app/src/app.ts:372:22)
    at async App.exportGameList (file:///app/src/app.ts:394:9)
Exported stat.ink: 0
    at async showError (file:///app/src/utils.ts:75:12)
    at async Promise.all (index 0)
    at async App.exportOnce (file:///app/src/app.ts:231:7)
    at async App.monitor (file:///app/src/app.ts:296:7)
    at async App.run (file:///app/src/app.ts:332:7)
    at async showError (file:///app/src/utils.ts:75:12)

I am unsure if this happens with normal games too as I quickly killed s3si.ts after noticing this

To Reproduce
Steps to reproduce the behavior:

  1. Use s3s to upload some salmon run jobs
  2. Run s3si
  3. Notice logs showing duplicated salmon run uploads
  4. See these uploaded on stat.ink

Expected behavior
s3si.ts should skip jobs uploaded by s3s.

Screenshots or Links
If applicable, add screenshots or links to stat.ink to help explain your problem.

Environment (please complete the following information):

  • OS: Linux (Docker on arm64 using this repo's Dockerfile modified to use LukeChannings's deno-arm64 images)
  • Deno version 1.26.2
  • Version 0c916cc

Another way to map special weapon

Because of the Splatnet update, the special weapon id information (#39) was removed from the Salmon Run data. So the old method failed.

Now the mapping can only be done by name or URL.

Support for Challenges

Describe the bug
Currently the stat.ink exporter throws a TypeError: Unknown vsMode LEAGUE and doesn't upload the battles

To Reproduce

  • Play a challenge
  • Run s3si and let it try to export to stat.ink

Environment (please complete the following information):

  • OS: windows/linux
  • Deno version: 1.34.1
  • Version: latest

TypeError: Cannot read properties of undefined (reading 'length')

root@Ubuntu:/home/s3sits# deno run -Ar s3si.ts [options]
TypeError: Cannot read properties of undefined (reading 'length')
at getIdToken2 (file:///home/s3sits/src/iksm.ts:223:82)
at eventLoopTick (ext:core/01_core.js:178:11)
at async retry (file:///home/s3sits/src/utils.ts:46:14)
at async getGToken (file:///home/s3sits/src/iksm.ts:275:35)
at async Splatnet3.fetchToken (file:///home/s3sits/src/splatnet3.ts:101:56)
at async Splatnet3.request (file:///home/s3sits/src/splatnet3.ts:86:9)
at async Splatnet3.getBankaraBattleHistories (file:///home/s3sits/src/splatnet3.ts:223:18)
at async file:///home/s3sits/src/GameFetcher.ts:104:61
at async Mutex.use (https://deno.land/x/[email protected]/semaphore.ts:45:19)
at async GameFetcher.updateRank (file:///home/s3sits/src/GameFetcher.ts:69:7)
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
No idToken2 or coralUserId found. Please try again later. (${idToken2.length}, ${coralUserId.length}),
^
at getIdToken2 (file:///home/s3sits/src/iksm.ts:223:82)
at eventLoopTick (ext:core/01_core.js:178:11)
at async retry (file:///home/s3sits/src/utils.ts:46:14)
at async getGToken (file:///home/s3sits/src/iksm.ts:275:35)
at async Splatnet3.fetchToken (file:///home/s3sits/src/splatnet3.ts:101:56)
at async Splatnet3.request (file:///home/s3sits/src/splatnet3.ts:86:9)
at async Splatnet3.getBankaraBattleHistories (file:///home/s3sits/src/splatnet3.ts:223:18)
at async file:///home/s3sits/src/GameFetcher.ts:104:61
at async Mutex.use (https://deno.land/x/[email protected]/semaphore.ts:45:19)
at async GameFetcher.updateRank (file:///home/s3sits/src/GameFetcher.ts:69:7)

Error

> $ deno run -Ar ./s3si.ts                                                                                                                                                                                                     [±main ●]
error: The module's source code could not be parsed: Expected ';', got 'with' at file:///home/ubuntu/s3si.ts/src/exporters/stat.ink.ts:43:48

  import GEAR_MAP from "../assets/gear-map.json" with { type: "json" };

RankTracker tracks season

And charge for challenge is changed between versions. s3si.ts should have a version table and track point by date and version

Cannot initialize on Windows

Describe the bug
s3si.ts failed to set-up properly, failed to read API.

To Reproduce
Steps to reproduce the behavior:

  1. Install deno through website.
  2. Run deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts [options]
  3. Follow on screen
  4. See error

Expected behavior
Proceed to the next step in setup.

Screenshots or Links
If applicable, add screenshots or links to stat.ink to help explain your problem.

298251994-55649558-f8c1-45f3-9866-8f7c9c82369b

Environment (please complete the following information):

  • OS: Windows 11
  • Deno version: 1.39.4
  • Version: 0.4.12

Additional context
Add any other context about the problem here.

Error: No idToken2 found

Describe the bug
When running, even after resetting profile.json

Fetching battle list...

APIError: No idToken2 found
Response: Response {
body: ReadableStream { locked: true },
bodyUsed: true,
headers: Headers {
allow: "POST, OPTIONS",
"content-type": "application/json",
date: "Wed, 24 May 2023 02:28:25 GMT",
"referrer-policy": "same-origin",
server: "gunicorn",
vary: "Accept-Encoding, Origin",
via: "1.1 google",
"x-content-type-options": "nosniff",
"x-frame-options": "DENY"
},
ok: true,
redirected: false,
status: 200,
statusText: "OK",
url: "https://api-lp1.znc.srv.nintendo.net/v3/Account/Login"
}
Body: {
status: 9403,
errorMessage: "Invalid token.",
correlationId: "d42fe333-29c0a73f"
}
error: Uncaught (in promise) Error: No idToken2 found
throw new APIError({
^
at getIdToken2 (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/iksm.ts:216:13)
at eventLoopTick (ext:core/01_core.js:181:11)
at async retry (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/utils.ts:46:14)
at async getGToken (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/iksm.ts:269:20)
at async Splatnet3.fetchToken (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/splatnet3.ts:101:56)
at async Splatnet3.request (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/splatnet3.ts:86:9)
at async Splatnet3.getBattleList (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/splatnet3.ts:168:12)
at async App.exportOnce (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:166:24)
at async App.monitor (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:296:7)
at async App.run (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:332:7)

Cannot Export Stats

Describe the bug
Recently, whenever I try to export my stats, I get the error "Cannot read properties of undefined (reading 'length')." I tried resetting my settings, relogging in to my Nintendo account for an account session token, regenerating my stat.ink API, and completely uninstalling the app, but the error persists. It was working for a while, then randomly stopped, and I'm unsure why.

To Reproduce
Steps to reproduce the behavior:
Unknown

Expected behavior
To be able to export my stats.

Screenshots or Links
image

Environment (please complete the following information):

  • OS: Win 10
  • Version 0.4.5

.AppImage is unusable

Describe the bug
AppImage's deno runtime is corrupted. By extracting the app-image, you can see s3si executable is a deno repl. But .deb file works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Download https://github.com/spacemeowx2/s3si.ts/releases/download/gui-v0.1.0/s3si-ts_0.1.0_amd64.AppImage
  2. chmod +x s3si-ts_0.1.0_amd64.AppImage
  3. ./s3si-ts_0.1.0_amd64.AppImage
  4. Login
  5. Click Export, see error

Expected behavior
No error

Screenshots or Links

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Version gui 0.1.0

Additional context
Add any other context about the problem here.

[Feature request] Fetch match history per mode

When exporting VS matches, s3si only exports the latest 50 matches from all modes combined. This results in a possible loss of match results when a user plays more than 50 matches across more than 2 modes before exporting them, even though they could be exported by querying match history per mode. s3s is capable of doing this (and is the default behavior), and it would be nice if s3si could do the same.

I think the s3si code is already capable of querying match history per mode, so the solution would be to actually use them. Also, this behavior is only required when 50 unexported matches are detected, so s3si can do it the smart way to reduce average number of requests by only query the mixed history first, then check if it needs to query history per mode.

Failure to export VS matches (possibly because of the latest Challenge?)

Describe the bug
Failure to export VS matches. s3si appears to have an issue with the "Sheldon's Dress-Up Showdown" Challenge (random weapons and gear). Salmon Run shifts upload as expected when choosing to skip VS match exporting.

To Reproduce
Steps to reproduce the behavior:

  1. Click "Export" in s3si-ts.exe OR run "deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts" in the command line.
  2. See error

Expected behavior
Exporting VS matches to stat.ink with no error.

Screenshots or Links
s3si error

Environment (please complete the following information):

  • OS: Windows 10 Pro (Build 19044.3086)
  • Deno version 1.37.2
  • Version v0.4.9

Additional context
The aforementioned Challenge grants you a random weapon and set of matching amiibo gear with the original primary abilities and no sub abilities.

Weapon not found

螢幕截圖 2022-11-26 21 37 19

Fetching battle list...
Exported stat.ink: 4
Fetching coop battle list...
Error: Weapon not found: 14式竹筒槍‧甲
    at StatInkExporter.mapCoopWeapon (file:///app/src/exporters/stat.ink.ts:477:13)
    at async Promise.all (index 1)
    at async StatInkExporter.mapCoopPlayer (file:///app/src/exporters/stat.ink.ts:503:16)
    at async Promise.all (index 0)
    at async StatInkExporter.mapCoop (file:///app/src/exporters/stat.ink.ts:641:16)
    at async StatInkExporter.exportGame (file:///app/src/exporters/stat.ink.ts:202:20)
    at async step (file:///app/src/app.ts:323:23)
    at async App.exportGameList (file:///app/src/app.ts:338:9)
    at async showError (file:///app/src/utils.ts:75:12)
    at async Promise.all (index 0)

Failed to export to stat.ink: Error: Weapon not found: 14式竹筒槍‧甲
    at StatInkExporter.mapCoopWeapon (file:///app/src/exporters/stat.ink.ts:477:13)
    at async Promise.all (index 1)
    at async StatInkExporter.mapCoopPlayer (file:///app/src/exporters/stat.ink.ts:503:16)
    at async Promise.all (index 0)
    at async StatInkExporter.mapCoop (file:///app/src/exporters/stat.ink.ts:641:16)
    at async StatInkExporter.exportGame (file:///app/src/exporters/stat.ink.ts:202:20)
    at async step (file:///app/src/app.ts:323:23)
    at async App.exportGameList (file:///app/src/app.ts:338:9)
    at async showError (file:///app/src/utils.ts:75:12)
Exported stat.ink: 0
    at async Promise.all (index 0)
Error: Weapon not found: 14式竹筒槍‧甲
    at StatInkExporter.mapCoopWeapon (file:///app/src/exporters/stat.ink.ts:477:13)
    at async Promise.all (index 1)
    at async StatInkExporter.mapCoopPlayer (file:///app/src/exporters/stat.ink.ts:503:16)
    at async Promise.all (index 0)
    at async StatInkExporter.mapCoop (file:///app/src/exporters/stat.ink.ts:641:16)
    at async StatInkExporter.exportGame (file:///app/src/exporters/stat.ink.ts:202:20)
    at async step (file:///app/src/app.ts:323:23)
    at async App.exportGameList (file:///app/src/app.ts:338:9)
    at async showError (file:///app/src/utils.ts:75:12)
    at async Promise.all (index 0)
error: Uncaught (in promise) Error: Weapon not found: 14式竹筒槍‧甲
      throw new Error(`Weapon not found: ${name}`);
            ^
    at StatInkExporter.mapCoopWeapon (file:///app/src/exporters/stat.ink.ts:477:13)
    at async Promise.all (index 1)
    at async StatInkExporter.mapCoopPlayer (file:///app/src/exporters/stat.ink.ts:503:16)
    at async Promise.all (index 0)
    at async StatInkExporter.mapCoop (file:///app/src/exporters/stat.ink.ts:641:16)
    at async StatInkExporter.exportGame (file:///app/src/exporters/stat.ink.ts:202:20)
    at async step (file:///app/src/app.ts:323:23)
    at async App.exportGameList (file:///app/src/app.ts:338:9)
    at async showError (file:///app/src/utils.ts:75:12)
    at async Promise.all (index 0)

Add nxapi znca API support

Is your feature request related to a problem? Please describe.
脚本添加对nxapi znca API的请求兼容

Describe the solution you'd like
现在公开的f-api只有api.imink.app/fnxapi-znca-api.fancy.org.uk/api/znca/f这两个,nxapi在请求时head需要额外的X-znca-PlatformX-znca-Version字段,具体见https://github.com/samuelthomas2774/nxapi-znca-api?tab=readme-ov-file#public-api
希望脚本可以适配一下,我对ts代码不熟悉就只能麻烦你改了

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
涉及f-api请求的地方加上这两个字段即可
image

APIError: No idToken2 found

APIError: No idToken2 found
Response:  Response {
  body: ReadableStream { locked: true },
  bodyUsed: true,
  headers: Headers {
  allow: "POST, OPTIONS",
  "content-type": "application/json",
  date: "Wed, 01 Mar 2023 10:20:28 GMT",
  "referrer-policy": "same-origin",
  server: "gunicorn",
  vary: "Accept-Encoding, Origin",
  via: "1.1 google",
  "x-content-type-options": "nosniff",
  "x-frame-options": "DENY"
},
  ok: true,
  redirected: false,
  status: 200,
  statusText: "OK",
  url: "https://api-lp1.znc.srv.nintendo.net/v3/Account/Login"
}
Body:  { status: 9403, errorMessage: "Invalid token.", correlationId: "7251d0ce-131fcc0b" }

Error: The provided session_token_code is invalid.

When genSessionError, The Nintendo API will report an error:

{
  error: "invalid_request",
  error_description: "The provided session_token_code is invalid"
}

And cause the following exception.

Error: No session token found
    at loginManually (file:///home/gyara/projects/wakare/s3si.ts/src/iksm.ts:78:11)
    at async App.run (file:///home/gyara/projects/wakare/s3si.ts/src/app.ts:302:28)
    at async showError (file:///home/gyara/projects/wakare/s3si.ts/src/utils.ts:68:5)
    at async file:///home/gyara/projects/wakare/s3si.ts/s3si.ts:40:1
error: Uncaught (in promise) Error: No session token found
    throw new Error("No session token found");
          ^
    at loginManually (file:///home/gyara/projects/wakare/s3si.ts/src/iksm.ts:78:11)
    at async App.run (file:///home/gyara/projects/wakare/s3si.ts/src/app.ts:302:28)
    at async showError (file:///home/gyara/projects/wakare/s3si.ts/src/utils.ts:68:5)
    at async file:///home/gyara/projects/wakare/s3si.ts/s3si.ts:40:1

stat.ink API Error "Rank After Exp must be no less than 0."

Describe the bug
Reporting to stat.ink causes API error { error: { rank_after_exp: "Rank After Exp must be no less than 0." } }, (maybe) after success of Rank-Up Battle.
Reproducing profile.json did not work.

To Reproduce

  1. Succeed 3 wins at Rank-Up Battle (I did S+19 -> S+20)
  2. Report with command deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts

Expected behavior
Reporting with no error.

Screenshots or Links

> deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts
Fetching battle list...
Export vs games
[                                                  ] stat.ink 0.00% 1.5s eta: - 0/3

APIError: Failed to export battle
Response:  Response {
  body: ReadableStream { locked: true },
  bodyUsed: true,
  headers: Headers {
  "accept-ch": "UA, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform, UA-Platform-Version",
  "access-control-allow-origin": "*",
  "alt-svc": 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
  "cache-control": "no-store, no-transform",
  "cf-cache-status": "DYNAMIC",
  "cf-ray": "7712a5399fd0af36-NRT",
  "content-type": "application/json; charset=UTF-8",
  date: "Mon, 28 Nov 2022 11:08:24 GMT",
  expires: "Thu, 19 Nov 1981 08:52:00 GMT",
  nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
  "permissions-policy": "interest-cohort=()",
  pragma: "no-cache",
  "report-to": '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=m0Xx0IUwom3uViuwpWwGJUFQzwnpwTqS2...',
  server: "cloudflare",
  "set-cookie": "_csrf=88821475e4b91016d30099f751379bc193bd12513223e54ccb264815e9519fd1a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22...",
  "strict-transport-security": "max-age=15552000; includeSubDomains; preload",
  "x-content-type-options": "nosniff",
  "x-frame-options": "SAMEORIGIN",
  "x-powered-by": "PHP/8.0.26",
  "x-ua-compatible": "IE=Edge",
  "x-xss-protection": "1;mode=block"
},
  ok: false,
  redirected: false,
  status: 400,
  statusText: "Bad Request",
  url: "https://stat.ink/api/v3/battle"
}
Body:  { error: { rank_after_exp: "Rank After Exp must be no less than 0." } }

Failed to export to stat.ink: Error: Failed to export battle
    at StatInkAPI.postBattle (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/exporters/stat.ink.ts:90:13)
    at async StatInkExporter.exportGame (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/exporters/stat.ink.ts:242:23)
    at async step (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:323:23)
    at async App.exportGameList (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:338:9)
    at async showError (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/utils.ts:75:12)
    at async Promise.all (index 0)
    at async App.exportOnce (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:152:7)
    at async App.run (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:282:7)
    at async showError (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/utils.ts:75:12)
    at async https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts:44:1

Exported stat.ink: 0


APIError: Failed to export battle
Response:  Response {
  body: ReadableStream { locked: true },
  bodyUsed: true,
  headers: Headers {
  "accept-ch": "UA, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform, UA-Platform-Version",
  "access-control-allow-origin": "*",
  "alt-svc": 'h3=":443"; ma=86400, h3-29=":443"; ma=86400',
  "cache-control": "no-store, no-transform",
  "cf-cache-status": "DYNAMIC",
  "cf-ray": "7712a5399fd0af36-NRT",
  "content-type": "application/json; charset=UTF-8",
  date: "Mon, 28 Nov 2022 11:08:24 GMT",
  expires: "Thu, 19 Nov 1981 08:52:00 GMT",
  nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
  "permissions-policy": "interest-cohort=()",
  pragma: "no-cache",
  "report-to": '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=m0Xx0IUwom3uViuwpWwGJUFQzwnpwTqS2...',
  server: "cloudflare",
  "set-cookie": "_csrf=88821475e4b91016d30099f751379bc193bd12513223e54ccb264815e9519fd1a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22...",
  "strict-transport-security": "max-age=15552000; includeSubDomains; preload",
  "x-content-type-options": "nosniff",
  "x-frame-options": "SAMEORIGIN",
  "x-powered-by": "PHP/8.0.26",
  "x-ua-compatible": "IE=Edge",
  "x-xss-protection": "1;mode=block"
},
  ok: false,
  redirected: false,
  status: 400,
  statusText: "Bad Request",
  url: "https://stat.ink/api/v3/battle"
}
Body:  { error: { rank_after_exp: "Rank After Exp must be no less than 0." } }
error: Uncaught (in promise) Error: Failed to export battle
      throw new APIError({
            ^
    at StatInkAPI.postBattle (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/exporters/stat.ink.ts:90:13)
    at async StatInkExporter.exportGame (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/exporters/stat.ink.ts:242:23)
    at async step (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:323:23)
    at async App.exportGameList (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:338:9)
    at async showError (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/utils.ts:75:12)
    at async Promise.all (index 0)
    at async App.exportOnce (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:152:7)
    at async App.run (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/app.ts:282:7)
    at async showError (https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/src/utils.ts:75:12)
    at async https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts:44:1

Environment (please complete the following information):

  • OS: Windows 10
  • Deno version 1.28.2 (release, x86_64-pc-windows-msvc)
  • Version 0.1.32

Use of deprecated "Deno.stdout.rid" API

Describe the bug
脚本所用函数在未来可能不被deno支持

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or Links
image

Environment (please complete the following information):

  • OS: centos7.9
  • Deno version 1.40.2
  • Version 0.4.12

Additional context
Add any other context about the problem here.

judgement "DRAW"

judgement: "LOSE" | "WIN" | "DEEMED_LOSE" | "EXEMPTED_LOSE";
missing "DRAW" ? there are five type of judgement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.