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.

67 lines
3.4 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
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. If no cookies file is provided, cookies from the local Firefox installation are used (Linux only).
  11. -d, --download-folder=<pathToDownloadFolder>
  12. The folder in which downloaded albums must be extracted.
  13. The following structure is considered: <pathToDownloadFolder>/<artist>/<year> - <album>.
  14. (default: current folder)
  15. -f, --audio-format=<audioFormat>
  16. The chosen audio format of the files to download (default: vorbis).
  17. Possible values: flac, wav, aac-hi, mp3-320, aiff-lossless, vorbis, mp3-v0, alac.
  18. -h, --help Display this help message.
  19. ```
  20. ## Bandcamp authentication
  21. This tool does not manage authentication with Bandcamp servers, as they require a valid token from Google Captcha.
  22. Hence, authentication must first be achieved using Firefox. Then there are two possibilities:
  23. - If running a Linux system (and if the `--cookies-file` parameter is not used), then the tool will automatically find the required cookies in the Firefox profile folder of the system user.
  24. - Else, 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/).
  25. This JSON file can then be used using the parameter `--cookies-file`:
  26. ## Installation
  27. After each commit, the continuous integration (CI) builds a new standalone (ie. that includes all dependencies) executable jar that can be used as is.
  28. The last produced jar can always be found [at this link](https://framagit.org/Gwendal/bandcamp-collection-downloader/-/jobs/artifacts/master/raw/build/libs/bandcamp-collection-downloader.jar?job=build).
  29. ## Usage
  30. Example of command:
  31. ```dtd
  32. $ java -jar bandcamp-collection-downloader.jar --cookies-file=cookies.json --download-folder=~/Music myBandcampIdentifier
  33. ```
  34. This will download all albums ever bought by the Bandcamp account *myBandcampIdentifier*,
  35. and extract the music in the folder `~/Music`,
  36. The tool always creates one folder per artist, each containing one folder per album (with the format `<year> - <album name>`).
  37. ## Compiling
  38. Compilation is handled by Gradle.
  39. A task `fatJar` is available to build a standalone executable jar with all dependencies:
  40. ```
  41. $ git clone https://framagit.org/Gwendal/bandcamp-collection-downloader.git
  42. $ cd bandcamp-collection-downloader
  43. $ gradle fatjar
  44. ```
  45. The resulting binary can then be found in `build/libs/bandcamp-collection-downloader.jar`.
  46. ## Dependencies
  47. This tool relies on the following libraries:
  48. - [jsoup](https://jsoup.org/) to get and parse HTML,
  49. - [zt-zip](https://github.com/zeroturnaround/zt-zip) to unzip downloaded albums,
  50. - [picocli](https://picocli.info/) to provide a fancy CLI,
  51. - [Gson](https://github.com/google/gson) to parse JSON.