mmarcincin / HB-DRM-free-bulk-downloader

powershell script for downloading humble bundle DRM-Free files
98 stars 14 forks source link

Example of global switch using #12

Closed GiuseppeChillemi closed 4 years ago

GiuseppeChillemi commented 4 years ago

For people unfamiliar with powershell it is not clear where to put global switches: powershell CLI ? Bat file ? .ps1 script ?

mmarcincin commented 4 years ago

There's no need for user to modify the script itself, you just need to edit links.txt using switches and links entered together. Switches change default global settings until they are modified again in links.txt. Bundle titles are ignored so something like this would work for pdf only downloads:

pdf

Cloud Computing Basics: A Self-Teaching Introduction https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX

This would change limitation to pdf only unless modified again below. It would download pdf files for titles which has them and first label of titles which are missing them. If you want to skip all titles which don't have pdf label, you'd have to use %strict too.

pdf

%strict Cloud Computing Basics: A Self-Teaching Introduction https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX

For all other combinations check the README.md file.

GiuseppeChillemi commented 4 years ago

I suggest changing the readme to something like the following text as I have totally missed global switches working:

1) Removing bullets from the examples.

2) Change the text to something like this:

Switches must be used inside links.txt file. They can be appended to the end of a single link as follow and they will work for that single bundle, then default (previous?) working will return.

(example of a link.txt file)

https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX#pdf https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX#pdf,epub,mp3

Global switches could be used before a list of bundle links. Those switches will be valid for the remaining of the list until another switch changes that specific working.

(example of a link.txt file)

pdf

https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX

pdf,epub,mp3

https://www.humblebundle.com/downloads?key=XXXXXXXXXXXXXXXX

none

(the last switch reverts everything to the default value and the script will return to downloading all versions)

...

mmarcincin commented 4 years ago

Yeah, I'll definitely remove bullet points from that and make it more clear. Thanks