Twitch-watcher icon indicating copy to clipboard operation
Twitch-watcher copied to clipboard

Add Check if valorant is dropped

Open guttir14 opened this issue 4 years ago • 2 comments

just post request to gql.twitch.tv/gql with Autorization token ( {Authorization: "Oauth " + cookie.token} ) in header and with body:

{
    "operationName": "OnsiteNotifications_ListNotifications",
    "variables": {
        "limit": 3,
        "cursor": "",
        "language": "en"
    },
    "extensions": {
        "persistedQuery": {
            "version": 1,
            "sha256Hash": "b317b93ed481bf07c35defbcf01848f09744805ebb640734763298f9a7dfd64f"
        }
    }
}

If result contains "You just received the **VALORANT**" then valorant has been dropped and we can console.log('dropped') and process.exit()

Also, to easy get token you can use next script in your browser console:

newWin=window.open("about:blank","","width=350,height=10");newWin.document.write(JSON.stringify(Object({token:cookies["auth-token"]})))

guttir14 avatar May 05 '20 19:05 guttir14

Or just emulate click on notifications button

guttir14 avatar May 05 '20 19:05 guttir14

Can you make a pull request please?

D3vl0per avatar May 05 '20 23:05 D3vl0per