You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.7 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # Bandcamp collection downloader
  2. A command-line tool written in Kotlin to automatically download all albums of a Bandcamp collection.
  3. ```
  4. Usage: <main class> [-h] -c=<pathToCookiesFile> [-d=<pathToDownloadFolder>] [-f=<audioFormat>] <bandcampUser>
  5. <bandcampUser> The bandcamp user account from which all albums must be downloaded.
  6. -c, --cookies-file=<pathToCookiesFile>
  7. A JSON file with valid bandcamp credential cookies.
  8. "Cookie Quick Manager" can be used to obtain this file after logging into bandcamp.
  9. (visit https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/).
  10. -d, --download-folder=<pathToDownloadFolder>
  11. The folder in which downloaded albums must be extracted.
  12. The following structure is considered: <pathToDownloadFolder>/<artist>/<year> - <album>.
  13. -f, --audio-format=<audioFormat>
  14. The chosen audio format of the files to download (default: vorbis).
  15. Possible values: flac, wav, aac-hi, mp3-320, aiff-lossless, vorbis, mp3-v0, alac.
  16. -h, --help Display this help message.
  17. ```
  18. ## Bandcamp authentication
  19. This tool does not manage authentication with Bandcamp servers, as they require a valid token from Google Captcha.
  20. Hence, authentication must first be achieved using Firefox, then Bandcamp cookies must be exported in JSON using the Firefox Addon [Cookie Quick Manager](https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/).
  21. This JSON file can then be used using the mandatory parameter `--cookies-file`:
  22. ## Usage
  23. Example of command:
  24. ```dtd
  25. $ java -jar bandcamp-collection-downloader-all.jar --cookies-file=cookies.json --download-folder=~/Music myBandcampIdentifier
  26. ```
  27. This will download all albums ever bought by the Bandcamp account *myBandcampIdentifier*,
  28. and extract the music in the folder `~/Music`,
  29. The tool always creates one folder per artist, each containing one folder per album (with the format `<year> - <album name>`).
  30. ## Compiling
  31. Compilation is handled by Gradle.
  32. A task `fatJar` is available to build a standalone executable jar with all dependencies:
  33. ```
  34. $ git clone https://framagit.org/Gwendal/bandcamp-collection-downloader.git
  35. $ cd bandcamp-collection-downloader
  36. $ gradle fatjar
  37. ```
  38. The resulting binary can then be found in `build/libs/bandcamp-collection-downloader-all.jar`.
  39. ## Dependencies
  40. This tool relies on the following libraries:
  41. - [jsoup](https://jsoup.org/) to get and parse HTML,
  42. - [zt-zip](https://github.com/zeroturnaround/zt-zip) to unzip downloaded albums,
  43. - [picocli](https://picocli.info/) to provide a fancy CLI,
  44. - [Gson](https://github.com/google/gson) to parse JSON.
  45. m.google.code.gson:gson:2.8.5'