A CLI batch downloader for your Bandcamp collection.

Overview

bandsnatch

A CLI batch downloader for your Bandcamp collection.

Bandsnatch is a Rust tool for downloading all of your Bandcamp purchases all at once in your desired format, and being able to be run multiple times when you buy new releases.

This project is heavily inspired by Ezwen's bandcamp-collection-downloader, which I used myself before this, specifically existing to help me learn Rust, but also to add some improvements over it that I've wanted.

State of the Project

This tool is still currently a work in progress, so bugs and other weirdness may occur. If anything weird happens or something breaks, please open an issue about it with information and reproduction steps if possible. Specifically testing use of this with large collections would be very helpful to see if there's any areas that I need to improve in.

If you're a developer poking around in the code, please note that this is my first proper project written using Rust, so code quality may be subpar, especially in terms of memory usage. If you have any ideas to improve the project in general I'd love to hear them.

Usage

The most basic usage is along the lines of bandsnatch -f <format> <username>, as it will try to automatically fetch cookies from a local cookies.json or from Firefox (TODO). But if this fails you can provide the -c option with a path to a cookies file to use.

For more advanced usage, you can run bandsnatch -h to get output similar to the following.

A CLI batch downloader for your Bandcamp collection

Usage: bandsnatch [OPTIONS] --format <AUDIO_FORMAT> <USER>

Arguments:
  <USER>  Name of the user to download releases from (must be logged in through cookies) [env: BS_USER=]

Options:
  -f, --format <AUDIO_FORMAT>   The audio format to download the files in [env: BS_FORMAT=] [possible values: flac, wav, aac-hi, mp3-320, aiff-lossless, vorbis, mp3-v0, alac]
  -c, --cookies <COOKIES_FILE>  [env: BS_COOKIES=]
  -F, --force                   Ignores any found cache file and instead does a from-scratch download run [env: BS_FORCE=]
  -j, --jobs <JOBS>             The amount of parallel jobs (threads) to use [env: BS_JOBS=] [default: 4]
  -n, --limit <LIMIT>           Maximum number of releases to download. Useful for testing [env: BS_LIMIT=]
  -o, --output-folder <FOLDER>  The folder to extract downloaded releases to [env: BS_OUTPUT_FOLDER=] [default: ./]
  -h, --help                    Print help information
  -V, --version                 Print version information

Besides these options, you can also use environment variables with the option name in SCREAMING_SNAKE_CASE, prefixed with BS_, so that if set up correctly you can just run bandsnatch and have it automatically download your collection to the folder you want.

Exmaple

bandsnatch -c ./cookies.json -f flac -o ./Music ovyerus

This would download my entire music collection into a local "Music" folder, and also create a bandcamp-collection-downloader.cache in the same directory, which then gets read on future runs in order to skip items it has already retrieved.

Authentication

Because Bandsnatch does not manage logging into Bandcamp itself, you need to provide it the authentication cookies. For Firefox users, you can extract a cookies.json with the Cookie Quick Manager extension, and on Chrome, you can use the Get cookies.txt extension, to extract the cookies in the Netscape format, which Bandsnatch also supports.

If you don't provide the --cookies option, Bandsnatch will attempt to automatically find a file named cookies.json or cookies.txt in the local directory and load it. Failing that, if you use Firefox on Windows or Linux, bandsnatch will try to automatically load the cookies from there if possible (TODO).

Installing

Binary builds of Bandsnatch are available on our releases page for Windows, Mac (both ARM & Intel), and Linux (various architectures).

Homebrew

brew install ovyerus/tap/bandsnatch

Scoop

scoop bucket add ovyerus https://github.com/Ovyerus/bucket
scoop install bandsnatch

AUR (unofficial)

An unofficial AUR package is available from wale at https://aur.archlinux.org/packages/bandsnatch. Either use your favourite AUR helper, or you can install it manually via the following:

git clone https://aur.archlinux.org/bandsnatch.git
cd bandsnatch
makepkg -si

Crate

cargo install bandsnatch

From source

Pull this repository and run cargo build --release, and look for the bandsnatch binary in ./target/release/.

License

This program is licensed under the MIT license (see LICENSE or https://opensource.org/licenses/MIT).

You might also like...
A collection of semi-useful tools made for GNU/Linux

DECTOOLS A collection of semi-useful tools made for GNU/Linux. Some may work on macOS, though functionality isn't a priority. Depenencies: python, bas

Just a collection of tiny Rust projects I've did. None warrant a whole repo rn

Daily Rust I try to write some tiny programs daily to gradually improve my Rust skills! Current Program Descriptions first_prog.rs: My first program a

A collection of tools for i3 that assist in window, workspace and output operations.

i3-valet A collection of tools for i3 that assist in window, workspace and output operations. i3-valet can be run directly from the command line or as

Mirroring remote repositories to s3 storage, with atomic updates and periodic garbage collection.

rsync-sjtug WIP: This project is still under development, and is not ready for production use. rsync-sjtug is an open-source project designed to provi

This library contains collection of all sorts of useful information for every country.

Keshvar This library contains collection of all sorts of useful information for every country. Package | Documentation | Repository Demo use keshvar::

Mod for Mega Man Battle Network Legacy Collection to restore the WWW base music in the postgame.

MMBNLC Postgame WWW Base Music mod This is a mod for Mega Man Battle Network Legacy Collection Vol. 2 adjusts the field music played in the WWW base i

A comprehensive collection of resources and learning materials for Rust programming, empowering developers to explore and master the modern, safe, and blazingly fast language.

🦀 Awesome Rust Lang ⛰️ Project Description : Welcome to the Awesome Rust Lang repository! This is a comprehensive collection of resources for Rust, a

Collection of immutable and persistent data structures written in Rust, inspired by the standard libraries found in Haskell, Closure and OCaml

PRust: (P)ersistent & Immutable Data Structures in (Rust) This library houses a collection of immutable and persistent data structures, inspired by th

A CLI tool to get help with CLI tools 🐙
A CLI tool to get help with CLI tools 🐙

A CLI tool to get help with CLI tools 🐙 halp aims to help find the correct arguments for command-line tools by checking the predefined list of common

Comments
  • Replace invalid folder names.

    Replace invalid folder names.

    Currently Bandsnatch has an error when it comes across a release with characters in its name which results in the release being skipped. We should either have a map of replacement characters to use, which are visually similar, or just remove them straight up.

    image

    bug good first issue 
    opened by Ovyerus 0
  • Debugging subcommands

    Debugging subcommands

    Bandsnatch should have a bunch of different subcommands which grab different information from Bandcamp and displays it as JSON for debugging/testing purposes.

    enhancement 
    opened by Ovyerus 0
  • Better logging

    Better logging

    Currently logging kinda sucks big time. Here's a list of some improvements

    • Show information about files/account being used right at the start like bandcamp-collection-downloader does.
      • Format
      • Username
      • Cookies path
      • Output path
      • etc.
    • Remove wonky debug logs that screw with the progress.
    • Use the log stuff we have already for these.
    • Have another progress bar/line for progress through the user's collection
    enhancement good first issue 
    opened by Ovyerus 0
Owner
Michael Mitchell
21, he/any, gen z, creative.
Michael Mitchell
Dechrome is a tool written in Rust for batch removing Chromium-based browsers.

Dechrome Dechrome is a tool written in Rust for batch removing Chromium-based browsers and installing Firefox as a replacement. Warning The script is

Ryze 7 Aug 29, 2023
A command-line downloader for sites archived on the Wayback Machine

This is a small command-line utility I wrote to help with browsing archived websites from the Wayback Machine, which can sometimes be pretty slow.

Jonas Schievink 7 Oct 18, 2022
cyberdrop-dl - cyberdrop.me Downloader written in Rust 🦀

cyberdrop-dl - cyberdrop.me Downloader written in Rust ??

wmw 103 Dec 28, 2022
nhdl - a command-line doujinshi downloader client built in rust!

nhdl nhdl - a command-line doujinshi downloader client built in rust! goals fast and asynchronous doujinshi downloader, supporting various doujinshi s

Lumine 2 Dec 23, 2022
Pixiv downloader written in rust.

zettai-ryouiki "Zettai ryōiki refers to the area of bare skin in the gap between overknee socks and a miniskirt." About Pixiv downloader written in ru

Kuba Ellwart 3 Dec 29, 2021
A bilibili downloader built by Tauri and the language you-know-who.

Bilibili Downloader A bilibili video downloader app built by Tauri, Vue and Rust! Explore the docs » View Demo · Report Bug · Request Feature Table of

王翼翔 35 Jun 19, 2023
Requestty - An easy-to-use collection of interactive cli prompts inspired by Inquirer.js.

Requestty requestty (request-tty) is an easy-to-use collection of interactive cli prompts inspired by Inquirer.js. Easy-to-use - The builder API and m

null 160 Dec 28, 2022
booky is a minimalstic Tui tool for managing your growing book collection.

booky booky is a minimalistic TUI tool for managing your growing book collection. It is writtin in Rust and uses diesel as it's orm together with sqli

null 3 Jul 21, 2023
Create `.gitignore` files using one or more templates from TopTal, GitHub or your own collection

gitnr A cross-platform CLI utility to create .gitignore files using templates. Use templates from the GitHub & TopTal collections Use local files and

reemus.dev 25 Sep 2, 2023
A collection of numeric types and traits for Rust.

num A collection of numeric types and traits for Rust. This includes new types for big integers, rationals (aka fractions), and complex numbers, new t

null 813 Dec 27, 2022