itch.io icon indicating copy to clipboard operation
itch.io copied to clipboard

Download purchases through API

Open MarkOates opened this issue 1 year ago • 2 comments

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 avatar Mar 22 '24 16:03 MarkOates

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.

MarkOates avatar Mar 24 '24 14:03 MarkOates

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.

mainrs avatar Apr 25 '24 10:04 mainrs