Last active
August 29, 2015 14:05
-
-
Save retvil/97a2b9105e5476393671 to your computer and use it in GitHub Desktop.
[IOC] Free Steam (Remove DLC)
This file contains hidden or 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
///Workerd on Script: lunboks | |
///Editor: Nod33Eset | |
///Tester: | |
(function () { | |
var NUKE_REGEX = /\b(?:trailer|teaser|demo|cinematic|pegi|esrb)\b/i; | |
var PACKAGE_ID_REGEX = /javascript:\s*RemoveFreeLicense\s*\(\s*(\d+)/; | |
var REMOVE_LICENSE_API = "/account/removelicense"; | |
var RUN_ON_PAGE = "https://store.steampowered.com/account/"; | |
if (location.href !== RUN_ON_PAGE) { | |
if (confirm("You're not on your licenses page. Go now?")) { | |
location.assign(RUN_ON_PAGE); | |
} | |
return; | |
} | |
var idsToRemove = [ | |
12275, // Dungeon Defenders Capture the Flag Pre-Alpha Pass | |
12997, // Sanctum: X-Mas Carnage | |
13048, // Bunch of Heroes: Holiday Pack | |
13206, // Choplifter HD - Zombie Zombie Zombie Retail | |
13261, // RACE 07: Andy Priaulx Crowne Plaza Raceway | |
13275, // Delve Deeper User-Created DLC | |
13437, // Skyrim: High Resolution Texture Pack | |
13512, // Choplifter HD - Zombie Zombie Zombie | |
13570, // Wargame: European Escalation - Fatal Error | |
13685, // Alan Wake LatAm Spanish | |
13772, // Wargame: European Escalation - New Battlefields | |
13794, // Take on Helicopters - Rearmed | |
14151, // Wargame: European Escalation - New Battlefields | |
14358, // Wargame: European Escalation - Fatal Error | |
14520, // Sanctum: Yogscave | |
14699, // RResident Evil: Operation Raccoon City: Free Echo Six Prologue Mission | |
14981, // Dungeons of Dredmor: You Have To Name The Expansion Pack | |
15092, // Wargame: European Escalation - Conquest | |
15149, // Pro Cycling Manager 2012 - STAGE PACK | |
15193, // Wargame: European Escalation - Commander | |
15296, // Omerta City of Gangsters - The Bulgarian Colossus DLC | |
15301, // Wargame: European Escalation - Conquest" | |
15488, // Hard Reset: Exile DLC | |
16128, // Sleeping Dogs: HD pack | |
16916, // Wargame: European Escalation - Commander | |
17615, // DmC Devil May Cry: Bloody Palace Mode | |
17921, // Sleeping Dogs: Ghost Pig | |
18476, // Sleeping Dogs: HD pack JP | |
18536, // Omerta City of Gangsters - The Bulgarian Colossus DLC | |
18806, // A Virus Named TOM: Winter Wonderland | |
18865, // DmC Devil May Cry: Bloody Palace Mode LV | |
18940, // Worms Ultimate Mayhem - Single Player Pack DLC | |
18978, // Magicka: Free Jolnir's Workshop | |
18996, // Painkiller Hell & Damnation: Satan Claus DLC | |
19266, // Pro Evolution Soccer 2013 Data Pack DLC | |
19315, // Omerta- The Bulgarian Colossus DLC | |
1947, // The Witcher: Director's Cut Update | |
20626, // Pro Cycling Manager 2012 | |
25219, // A Virus Named TOM: Winter Wonderland Comp | |
25251, // Magicka: Jolnirs Workshop | |
25509, // Waking Mars - Soundtrack Comp | |
25518, // DayZ Mod | |
25734, // DmC Devil May Cry: Bloody Palace Mode | |
25735, // DmC Devil May Cry: Bloody Palace Mode LV | |
25768, // Delve Deeper: Gratis Grottos DLC | |
25845, // Afterfall Dirty Arena DLC | |
26076, // Worms Ultimate Mayhem - Single Player Pack DLC | |
26624, // Waking Mars - Soundtrack | |
26775, // Resident Evil 6 Wallpaper | |
27535, // X3: Reunion Bonus Package | |
27690, // Metro: Last Light - Novel | |
28350, // Substance Designer Free DLC | |
30540, // LOST PLANET® 3 - Hi Res Movies | |
30828, // Grimm Episode 1 - Demo | |
31285, // GRID 2 - Demolition Derby Pack | |
31538, // Prime World - Prime Machine | |
31761, // PAC-MAN MUSEUM™ - Ms. PAC-MAN™ DLC | |
32032, // Portal 2 - Perceptual Pack | |
32287, // Z3TA+2 - Polybius 8-bit Game Pack | |
3261, // RACE 07: Crowne Plaza Addon | |
32826, // Farming Simulator 2013 - Classics | |
33444, // Wargame: AirLand Battle - Magna Carta DLC | |
33694, // Grimm DLC 1 - A Boy Learns What Fear Is | |
34414, // Realms of Arkania: Blade of Destiny - Ogredeath DLC | |
34503, // Saints Row IV - Thank You Pack | |
35261, // Finding Teddy Soundtrack | |
35433, // Call of Duty®: Ghosts - Festive Personalization Pack | |
35530, // MODO Sample Content | |
35594, // Alan Wake Bonus Materials | |
35984, // MODO Sample Content | |
36116, // PAYDAY 2: The Charlie Santa Heist | |
36179, // Alan Wake Bonus Materials | |
36472, // Europa Universalis IV: Songs of Yuletide | |
36473, // Crusader Kings II: Songs of Yuletide | |
36615, // Grimm Episode 1 | |
36616, // Grimm Episode 1 | |
37861, // PAC-MAN MUSEUM™ - Ms. PAC-MAN™ DLC | |
38085, // Saints Row IV - Reverse Cosplay Contest | |
38512, // Vanguard Princess Director's Cut | |
42327, // GRID Autosport - High Res Texture Pack | |
42889, // Dusty Revenge - Almost Human | |
42929, // Skullgirls: Big Band | |
43233, // Nobunaga's Ambition: Souzou - "Teru Kushihashi", "Chiyome Mochiduki" Bushou Data | |
43235, // Nobunaga's Ambition: Souzou - "Motonobu Serada", "Tsuru Oohouri" Bushou Data | |
43237, // Nobunaga's Ambition: Souzou - "Goemon Ishikawa", "Yasuke" Bushou Data | |
43435, // Nobunaga's Ambition: Souzou - Series 30th Anniversary Contents | |
43437, // Nobunaga's Ambition: Souzou - "Nobunaga's Ambition Day" | |
43991, // Pure Pool - VooFoo DNA | |
44149, // Ground Pounders - High Rez Pack | |
45473, // Take on Helicopters - Noisecontrollers | |
45773, // Nobunaga's Ambition: Souzou - Nobunaga Oda In-Game Face CG | |
46062, // Hegemony Rome: The Rise of Caesar - Bannermen Pack | |
46109, // X3: Terran Conflict Bonus Package | |
46110, // X3: Albion Prelude Bonus Package | |
47445, // Wargame Red Dragon - The Millionth Mile | |
48171, // Skullgirls: Big Band | |
48578, // DW8XLCE - JAPANESE VOICE OPTION | |
49153, // Wargame Red Dragon - Second Korean War | |
]; | |
var rows; | |
var licensesTable = document.getElementById("licenses"); | |
var packageId; | |
if (licensesTable && window.g_sessionID) { | |
licensesTable = licensesTable.getElementsByClassName("account_table")[0]; | |
rows = licensesTable.rows; | |
for (var i = 0, l = rows.length; i < l; i++) { | |
if (NUKE_REGEX.test(rows[i].cells[0].textContent)) { | |
packageId = PACKAGE_ID_REGEX.exec(rows[i].cells[1].innerHTML); | |
if (packageId !== null) { | |
idsToRemove.push(packageId[1]); | |
} | |
} | |
} | |
function removePackageAndQueueNext(packages, index) { | |
if (index >= packages.length) { | |
console.log("Packages Removed."); | |
return; // done | |
} | |
var parameters = "?sessionid=" + encodeURIComponent(g_sessionID) + "&packageid=" + encodeURIComponent(packages[index]); | |
var xhr = new XMLHttpRequest(); | |
xhr.open("HEAD", REMOVE_LICENSE_API + parameters, true); | |
xhr.onreadystatechange = function () { | |
if (this.readyState === 4) { | |
console.log("Removed Package %d/%d", index + 1, packages.length); | |
removePackageAndQueueNext(packages, index + 1); | |
} | |
}; | |
xhr.send(); | |
} | |
if (idsToRemove.length > 0) { | |
removePackageAndQueueNext(idsToRemove, 0); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment