-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Itch.io Integration #46
Comments
As I understand it, the itch.io server-side and OAuth APIs are for sellers to provide integration for games, and there isn't a way to use it for getting games you bought, generate download URLs, etc. The official itch app (https://github.com/itchio/itch) uses butler, but the APIs it uses require running it as a JSON-RPC daemon. The butlerd docs are available at https://docs.itch.ovh/butlerd/master/, but as a general reference, getting authenticated works like such:
For // function called by itch's reCAPTCHA on success.
// otherwise you could watch document.getElementById("g-recaptcha-response")
function onRecaptcha(response) {
// "namespace" our message so we don't try to consume a stray Steam message
window.opener.postMessage("__ITCH_CAPTCHA_" + response, "*");
} Once solved, you can return the response string in the RPC call. The other API calls are pretty straightforward, but handling two-way JSON-RPC in shell scripts would be a challenge. Logs are also sent through JSON-RPC calls, so you'd likely want at least one long-lived TCP connection to output them. Footnotes |
Awesome! Thanks for your research! Sorry for my delay, I had been distracted by many life events... It seems from my little knowledge of frontend dev that you have successfully gone through the process of authenticating via a web form login through butler, including handling CAPTCHA (which sucks) and TOTP challenges, but I am not totally confident you have received the valid token, it seems you're saying the end product is a login within the browser, is that correct? I may need to look at butler docs for token output info I guess... Not sure if I am being a bother, but if you're ever free and willing, is there a way you can prepare a simple shell script to test auth, and maybe use jq to handle json tasks if necessary? If not, just write down the simplest steps so I can try in future (WHEN I EVER HAVE TIME >_<) The ideal way to know we have succeeded on "authorized-for-download" status for this is if the user token is fetched/printed/written I think. Feel free to say hi or ask any questions on my discord @Aeonitis if interested |
The flow I followed is a bit different, but the end result is the same! itch.io only provides non-creator APIs (i.e., listing owned games, downloading, etc) for what they call That said, since writing that message, I found the login "API" is better described in their Go library, in
Not a bother, but it's unfortunately not easy to handle in a shell script. I was looking into making a custom backend, but ran out of steam building it for that reason. The biggest issues are the CAPTCHA (which requires a web browser you can inject JS into1) and two-way TCP communication being a nuisance through bash/netcat. That said: I was building a demonstration Decky plugin, mostly to convince myself any of this was possible.I think the Python backend could be useful for better explaining the JSON-RPC API, although a flow diagram might help more. I haven't had much time to keep working on it, but I'll upload it to GitHub (and possibly make said flow diagram?) when I next have a chance. Footnotes
|
@snowkat that's amazing stuff. FYI months ago I made a python app, my own itch client on a free weekend that does login successfully but without any webpage, just username and password authentication. Cookie type key is what it is for me too actually 😂 Unfortunately the project requires web based login, I was told. My app also managed downloads and images successfully, and persistence with shell, python and sqlite, which I chose to be consistent with this project and other technical reasons too... Pretty much many steps have already ticked out but I haven't made more time for that project. See what works for you, but again, I'm here https://discord.gg/s2BZeQgQ |
Is your feature request related to a problem? Please describe.
Integration of Itch.io games into the Junkstore plugin. First of all, I love all your work here!
I would love to do this but I am unfortunately busy on my own non-steam app :'( Just adding this here so you can correct me, and make it easier for others to jump in and smash it into reality. No rush in responding, take your time!
Draft Plan
Next Steps
Current Observations [Epic Integration]
Login
How the third-party in-game-mode browser user login is handled for other stores (Epic)...
Login
setup initiated via Plugin in main.pyjunkstore/main.py
Line 240 in e115250
static.json button
junkstore/defaults/scripts/Extensions/Epic/static.json
Line 88 in e115250
Epic
and the actionlogin
Epic_login
store.shjunkstore/defaults/scripts/Extensions/Epic/store.sh
Line 308 in e115250
where the steam env variables ensure the environment specific to Steam context is correctly set
junkstore/defaults/scripts/shared.sh
Line 200 in e115250
and it moves on to
junkstore/defaults/scripts/Extensions/Epic/store.sh
Line 312 in e115250
to construct a JSON for login...
Uses tool to authenticate via CLI on Epic specific launcher Legendary
junkstore/defaults/scripts/Extensions/Epic/login.sh
Line 13 in e115250
Arg info from Legendary documentation -v, --debug means Set loglevel to debug
Current Auth ID data in game logs, stored as appId.log e.g.
cd1b8a6********************cf7b7f536.log
which is 'Night in the Woods'.Client caching on deck is handled by sqlite 3:
junkstore/defaults/scripts/shared/GamesDb.py
Line 2 in befe4d0
&
junkstore/defaults/scripts/shared/GameSet.py
Line 10 in befe4d0
Questions
Fundamental questions here to help make the process easier for whichever dev takes on some of this work, based on what I learned from skimming through the repo and especially this commit
Describe the solution we'd like
API integration
Scripting and Configuration Adjustments
Add
defaults/scripts/Extensions/Itch/store.sh
:Add
defaults/scripts/itch-config.py
:Backend Python Modifications
defaults/scripts/itch.py
:defaults/scripts/shared/GameSet.py
andGamesDb.py
:Database Schema Enhancement
Frontend Integration
src/Components/GameDetailsItem.tsx
:Again, my two cents just to push us a little forward, Keep up the awesome work :D
The text was updated successfully, but these errors were encountered: