Skip to content

Commit

Permalink
Support steam inventory images (fixes #1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Aug 18, 2024
1 parent 026ec26 commit 8b21144
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bugfixes:
* Fix GM_download headers for Tampermonkey and Violentmonkey
* Fix header parsing for Tampermonkey BETA (thanks to Broly for reporting)

Special thanks to thiagojramos, fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus, sn3akyb3ar, n0stal6ic, nyahgust, vscum, TristanWasTaken, BlindWanda, SUPER7X, n0099, remlap, CetaceanNation, bsydow, tathastu871, roi, ItsProyal, lazybookwyrm, James Joint, Machou, Broly, siloricity, ValiumBear, siloricity, evilxsloth, leoli1110 for their contributions and reports for this release
Special thanks to thiagojramos, fireattack, nimbuz, Froktime, fyhtma, SakalliTavernaci, TheLastZombie, oifj34f34f, Solus, sn3akyb3ar, n0stal6ic, nyahgust, vscum, TristanWasTaken, BlindWanda, SUPER7X, n0099, remlap, CetaceanNation, bsydow, tathastu871, roi, ItsProyal, lazybookwyrm, James Joint, Machou, Broly, siloricity, ValiumBear, siloricity, evilxsloth, leoli1110, ljcool2006 for their contributions and reports for this release

---

Expand Down
10 changes: 10 additions & 0 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37538,6 +37538,16 @@ var $$IMU_EXPORT$$;
url: src,
bad: "mask"
};

// thanks to ljcool2006 on github: https://github.com/qsniyg/maxurl/issues/1338
// https://community.akamai.steamstatic.com/economy/image/RgGbIK_Xaakl8PcQ2KQKK0i_2YIC7wZf7gTzKvLti-4wttL6ECYQfWnVrvtPO17Cg21bxebO3U9ipAtKlE8ALp2SN7cy4BnDeP3mbTsvYTyjoI8dxrcZq7BhYmFUB80R9lCkKSBHR24nqw/330x192?allow_animated=1
// https://community.akamai.steamstatic.com/economy/image/RgGbIK_Xaakl8PcQ2KQKK0i_2YIC7wZf7gTzKvLti-4wttL6ECYQfWnVrvtPO17Cg21bxebO3U9ipAtKlE8ALp2SN7cy4BnDeP3mbTsvYTyjoI8dxrcZq7BhYmFUB80R9lCkKSBHR24nqw/?allow_animated=1
newsrc = src.replace(/(\/economy\/+image\/+[^/]+\/+)[0-9]+x[0-9]+([?#].*)?$/, "$1$2");
if (newsrc !== src)
return {
url: newsrc,
head_wrong_contentlength: true
};
}

if ((domain_nosub === "steamstatic.com" && domain.match(/(?:cdn|shared)\.[^.]*\.steamstatic\.com/)) ||
Expand Down
9 changes: 9 additions & 0 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -34342,6 +34342,15 @@ var $$IMU_EXPORT$$;
url: src,
bad: "mask"
};
// thanks to ljcool2006 on github: https://github.com/qsniyg/maxurl/issues/1338
// https://community.akamai.steamstatic.com/economy/image/RgGbIK_Xaakl8PcQ2KQKK0i_2YIC7wZf7gTzKvLti-4wttL6ECYQfWnVrvtPO17Cg21bxebO3U9ipAtKlE8ALp2SN7cy4BnDeP3mbTsvYTyjoI8dxrcZq7BhYmFUB80R9lCkKSBHR24nqw/330x192?allow_animated=1
// https://community.akamai.steamstatic.com/economy/image/RgGbIK_Xaakl8PcQ2KQKK0i_2YIC7wZf7gTzKvLti-4wttL6ECYQfWnVrvtPO17Cg21bxebO3U9ipAtKlE8ALp2SN7cy4BnDeP3mbTsvYTyjoI8dxrcZq7BhYmFUB80R9lCkKSBHR24nqw/?allow_animated=1
newsrc = src.replace(/(\/economy\/+image\/+[^/]+\/+)[0-9]+x[0-9]+([?#].*)?$/, "$1$2");
if (newsrc !== src)
return {
url: newsrc,
head_wrong_contentlength: true
};
}
if ((domain_nosub === "steamstatic.com" && domain.match(/(?:cdn|shared)\.[^.]*\.steamstatic\.com/)) ||
// https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/2c/2c43030ea4900ebfcd3c42a4e665e9d926b488ef_medium.jpg
Expand Down

0 comments on commit 8b21144

Please sign in to comment.