Skip to content
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

Download purchases through API #1569

Open
MarkOates opened this issue Mar 22, 2024 · 2 comments
Open

Download purchases through API #1569

MarkOates opened this issue Mar 22, 2024 · 2 comments

Comments

@MarkOates
Copy link

MarkOates commented Mar 22, 2024

Problem

I recently bought a lot of asset packs as part of the Spring Sale 2024. I now have a long list of things to download and consolidate, and it would be nice if I there were a direct way to access the asset pack files directly through an API request (using curl and a token, for example).

API Feature Request

Probably an API endpoint that would provide a direct download.

  • https://itch.io/api/1/KEY/game/GAME_ID/downloads - would list downloadable files in the pack
  • https://itch.io/api/1/KEY/game/GAME_ID/download?asset=7a3bgqxf84x5 - would provide direct download to file

This is something similar to https://itch.io/api/1/KEY/game/GAME_ID/purchases.

Some other solutions

  • I download each .zip file manually one-by-one.
  • Some technique to use CURL to store cookies and act as myself logged in, seems a bit hacky.
  • Automate browser control with an AppleScript (osascript from command line)
  • Something else that's much better and lets me be sure all the datasets stay in sync? 🙏 ✨
@MarkOates
Copy link
Author

MarkOates commented Mar 24, 2024

Quick update on this issue. I've worked out a process by pulling HTML from the my purchases page, parsing with a Ruby script to generate a CSV that I imported to Google Sheets. Then using a very elaborate AppleScript (ran via osascript from the terminal manually for each asset pack), I automated the control of the browser to go to the download page for the asset pack, find and click each download button, record the text label next to that download, and then move the downloaded assets with a download_log.txt file into that asset pack's folder in the final Assets/ folder.

The process was good enough and it took me about a whole day to download all the files.

@mainrs
Copy link

mainrs commented Apr 25, 2024

There is also a bunch of userscripts that do the same: https://greasyfork.org/en/scripts/by-site/itch.io

You require a userscript browser extension like Greasemonkey. Please make sure to take a look at the scripts and don't run them blindly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants