MestreLion / humblebundle

API for managing Humble Bundle games library
GNU General Public License v3.0
211 stars 38 forks source link

Feature request: way to download bundle in one fell swoop #14

Open bradgy opened 8 years ago

bradgy commented 8 years ago

as well as an individual file download option, it'd be handy to be able to pull down all files of a given type in an entire bundle. I'm thinking specifically for my use case of ebooks/comics, which might have up to 50 or so files in a bundle, where I could just go and get every cbz, epub, or pdf at once. Is this feasible? Would HB frown on having their API hit like this? I have very little python experience but happy to help make this happen. Cheers.

parkerlreed commented 8 years ago

Also a way to just download EVERYTHING would be great. I'd like to archive all available games (possibly sorted by bundle), in every available format.

MestreLion commented 8 years ago

Those are great suggestions, thanks!

While all of this is surely feasible, I believe such features belong to a shell script. The console script already has a huge list of options, and this is trivial to do in a bash script using the existing command line options. I'd like to avoid cluttering the options even further for features that could be chained from the basic ones, like a for loop on the games list (or per bundle) that downloads each game using --platform or --type as a filter.

However, I'd be more than happy to include such script in the repo, if anyone is willing to code it. I'd also appreciate suggestions for command line option names and letters for this "batch mode", if we ever merge this in main script.

jherazob commented 8 years ago

Agreed, this sounds more like a job for a shell script. Something like this to download every audio thing (untested, don't just use it like this):

for audiothing in $(humblebundle.py -l -p audio) ; do 
  humblebundle.py -f /some/directory/with/lots/of/space -d $audiothing
done

At least that's how i'd do it

emorrp1 commented 8 years ago

I agree it can be done with the existing api, but integrating the feature allows for e.g. resuming download in a directory that already contains most of your humble library, checking for updates, specifying a subdirectory naming scheme e.g. based on platform or language. If you do end up implementing this feature, I would recommend looking at lgogdownloader for ideas and its manpage for naming options.

jmtd commented 7 years ago

I'm looking at using this to download a torrent of anything I've bought that offers a torrent, in all possible formats; it's certainly possible with scripts (first step: -l to get a list of all products) but it's not trivial because you don't know until you inspect each product what platforms, architectures, etc. are available, so you'd need to also do a show (probably with JSON output), then interpret the JSON to get the download flags right, etc.... which is starting to get "interesting" to do in shell.

MestreLion commented 7 years ago

@jmtd "interesting" in shell script, but still trivial in a python script, importing this package as a library.

I'm not saying I'm opposing such feature, I just really don't have the time to code it, so I'm thinking about alternate solutions... still, Pull Requests are welcome :)

jmtd commented 7 years ago

@jmtd "interesting" in shell script, but still trivial in a python script, importing this package as a library.

Sure, thanks; I hadn't thought of importing this package as a library, that would make it much easier

I'm not saying I'm opposing such feature, I just really don't have the time to code it, so I'm thinking about alternate solutions... still, Pull Requests are welcome :)

Great! I actually started a (shell) script to do this, and intended to stuff it into a contrib/ directory (or similar) in a fork and raise a PR. I might re-start as Python, though, as I've already hit pain points in shell, and I only spent around 30 minutes on it.

emorrp1 commented 7 years ago

@jmtd see also the Usage as a library example for a head start.

chtk commented 7 years ago

I've been working on a script written in bash, which uses jq to query the json output of humblebundle.py. It can

Right now it uses a hardcoded path to store downloads (bundle/platform). I'm planning on adding configurable storage paths, but haven't gotten around to that yet.

The script is pretty slow. Mainly because of the many calls to jq. But it might be interesting to someone implementing a proper script.

Two-Tone commented 7 years ago

For mass downloading, there is hb-downloader, which is written in Python 2.7 and has a MIT license, but has not had any commits in over a year and does not work as a result. Maybe that could be used as a basis?

MayeulC commented 6 years ago

@Two-Tone I forked this a while ago there, and fixed it: https://github.com/MayeulC/hb-downloader and was presently going trough a round of improvements (not pushed yet). I just discovered this tool, and I have been wondering what could be done to merge both, or even if it would be useful to do so. I guess I'll open an issue here... (done: #47)

parkerlreed commented 6 years ago

@MayeulC Sweet! Gave it a try but after authy it errors out asking if I'm a robot :)

If that's in the current set of changes, then woohoo.