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.

73 lines
3.9 KiB

7 years ago
7 years ago
7 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 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>] [-r=<retries>] [-t=<timeout>]
  5. <bandcampUser>
  6. <bandcampUser> The bandcamp user account from which all albums must be downloaded.
  7. -c, --cookies-file=<pathToCookiesFile>
  8. A JSON file with valid bandcamp credential cookies.
  9. "Cookie Quick Manager" can be used to obtain this file after logging into bandcamp.
  10. (visit https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/).
  11. If no cookies file is provided, cookies from the local Firefox installation are used (Windows and Linux
  12. only).
  13. -d, --download-folder=<pathToDownloadFolder>
  14. The folder in which downloaded albums must be extracted.
  15. The following structure is considered: <pathToDownloadFolder>/<artist>/<year> - <album>.
  16. (default: current folder)
  17. -f, --audio-format=<audioFormat>
  18. The chosen audio format of the files to download (default: vorbis).
  19. Possible values: flac, wav, aac-hi, mp3-320, aiff-lossless, vorbis, mp3-v0, alac.
  20. -h, --help Display this help message.
  21. -r, --retries=<retries> Amount of retries when downloading an album.
  22. -t, --timeout=<timeout> Timeout in ms before giving up an HTTP connection.
  23. ```
  24. ## Bandcamp authentication
  25. This tool does not manage authentication with Bandcamp servers, as they require a valid token from Google Captcha.
  26. Hence, authentication must first be achieved using Firefox. Then there are two possibilities:
  27. - If running a Windows or 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.
  28. - 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/).
  29. This JSON file can then be used using the parameter `--cookies-file`:
  30. ## Installation
  31. After each commit, the continuous integration (CI) builds a new standalone (ie. that includes all dependencies) executable jar that can be used as is.
  32. 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).
  33. ## Usage
  34. Example of command:
  35. ```dtd
  36. $ java -jar bandcamp-collection-downloader.jar --cookies-file=cookies.json --download-folder=~/Music myBandcampIdentifier
  37. ```
  38. This will download all albums ever bought by the Bandcamp account *myBandcampIdentifier*,
  39. and extract the music in the folder `~/Music`,
  40. The tool always creates one folder per artist, each containing one folder per album (with the format `<year> - <album name>`).
  41. ## Compiling
  42. Compilation is handled by Gradle.
  43. A task `fatJar` is available to build a standalone executable jar with all dependencies:
  44. ```
  45. $ git clone https://framagit.org/Gwendal/bandcamp-collection-downloader.git
  46. $ cd bandcamp-collection-downloader
  47. $ gradle fatjar
  48. ```
  49. The resulting binary can then be found in `build/libs/bandcamp-collection-downloader.jar`.
  50. ## Dependencies
  51. This tool relies on the following libraries:
  52. - [jsoup](https://jsoup.org/) to get and parse HTML,
  53. - [zt-zip](https://github.com/zeroturnaround/zt-zip) to unzip downloaded albums,
  54. - [picocli](https://picocli.info/) to provide a fancy CLI,
  55. - [Gson](https://github.com/google/gson) to parse JSON files,
  56. - [[ini4j]](http://ini4j.sourceforge.net/) to parse INI files,
  57. - [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) to read SQLite files.