Created
February 3, 2021 20:30
-
-
Save petersvp/270f7d5d7d548448f4897586a0d389c0 to your computer and use it in GitHub Desktop.
Batch Query Steam Keys for activation on SteamWorks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. GO TO SteamWorks, into the Query CD Key page, here: https://partner.steamgames.com/querycdkey/ | |
// 2. Fill in your keys below: | |
// 3. Go to DevTools, Console, and paste all of this here there! | |
// 4. Report will be printed to the console. | |
keys = ` | |
0ZQR4-N0H7K-AEJ77 | |
D05V5-P47AP-4ET3Q | |
GGJZ5-ZN0BR-F74C5 | |
FWZP4-2IXHB-GYV3A | |
` | |
var keylist = keys.split("\n"); | |
keylist.forEach(key => { | |
if(key.length<17) return; | |
function reqListener () { | |
let body = this.responseText; | |
let result = body.split('<h2>Activation Details</h2>')[1]; | |
if (!result && !err) { | |
console.log('Error quering CD Key ' + key); | |
} | |
result = result.split('</table>')[0]; | |
result = result.match(/<td>.*<\/td>/g); | |
result = result.map(function (line) { | |
return line.replace(/<[^>]*>/g, ''); | |
}); | |
let line = [key, (result[0] === 'Activated') ? '"' + result[1] + '"' : result[0]].join('\t'); | |
console.log(line); | |
} | |
var oReq = new XMLHttpRequest(); | |
oReq.addEventListener("load", reqListener); | |
oReq.open("GET", "https://partner.steamgames.com/querycdkey/cdkey?cdkey="+key+"&method=Query"); | |
oReq.send(); | |
}); |
Author
petersvp
commented
Feb 10, 2022
via email
I've ran 200 keys in one attempt with no any issues or timeouts.
…On Thu, Feb 10, 2022, 16:12 Gustav ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@Jimbly <https://github.com/Jimbly> Thank you. We've been using your
Node.js tool for a few years to great success. I was recently put in charge
of it and then I saw the comment from Peter and thought I'd look into the
updated version. Guess we'll stick to Node.js for now :)
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/270f7d5d7d548448f4897586a0d389c0#gistcomment-4060568>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJLYF7S34FE3TGTYF3UA4DU2PBWPANCNFSM4XCEZFPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
Yeah, a couple hundred keys should be fine in the browser, it's not that much traffic. Also, most browsers usually rate limit to 7 connections per host, although in modern days if Valve has switched to a load balancer/server that supports HTTP2 that goes out the window. If you're querying thousands of keys I might be a little careful =).
Chrome does rate-limit too, I managed to batch-check 500 keys with no issue. I want to keep this implementation as CLEAN as possible, so people can read what it do and not fear of self-xss attack towards them - after all, pasting untrusted code in the browser console is real concern nowadays, so i at least tried to make my implementation clear what it does :)
Appreciate this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment