Skip to main content

BandCamp Album Extractor

Download and organize your bandcamp library with ease!

Made with VHS

Install

(preferred) from pip

pip install bandcamp_extract

From github repo

To install this package simply run

pip install .

in the root of this package

Setup

After installation the extractor's binary is called bcextr.

Breaking change (0.2.0): bcextr is now a command group. What used to be bcextr <zip> is now bcextr extract <zip>.

bcextr extract works standalone with no setup. The bcextr api commands pull albums directly from your Bandcamp collection, which requires a one-time login first.

Bandcamp has no username/password API, so this reuses the same session cookie your browser already has after you log in on bandcamp.com.

1. Get your Bandcamp username

This is the name in the URL of your own collection page: https://bandcamp.com/<username>. You can find it in the account menu on bandcamp.com, or from the URL after clicking "Collection".

  1. Log in to bandcamp.com in your browser.
  2. Open developer tools (F12, or Cmd+Opt+I on macOS).
  3. Go to the Application tab in Chrome/Edge (Storage tab in Firefox), then Cookies → https://bandcamp.com in the left sidebar.
  4. Find the row named identity and copy its Value column. It's a long opaque string — copy the whole thing.

This cookie is a live login credential for your account: don't share it, paste it into chat tools, or commit it anywhere. bcextr only stores it locally in ~/.config/bcextr/session.json (readable only by you).

3. Log in with bcextr

bcextr api login

You'll be prompted for your Bandcamp username and the cookie value from the steps above.

If your cookie later expires, just re-run bcextr api login with a fresh value.

Shell completion (optional)

bcextr is built on Click, which provides tab-completion for subcommands (extract, api, mv, etc.) and file/directory paths (including for --pattern, which completes like a regular folder path). Add the line for your shell to its startup file, then restart your shell (or source the file):

bash (~/.bashrc):

eval "$(_BCEXTR_COMPLETE=bash_source bcextr)"

zsh (~/.zshrc):

eval "$(_BCEXTR_COMPLETE=zsh_source bcextr)"

fish: generate the completion file once (no eval-on-startup needed):

_BCEXTR_COMPLETE=fish_source bcextr > ~/.config/fish/completions/bcextr.fish

Usage

bcextr extract

Extract a zip you already downloaded:

bcextr extract ~/Downloads/album.zip --pattern ~/Music/{artist}/{album}/{title}

Default pattern if not provided is: ./{artist}/{album}/{title}

bcextr api list / bcextr api choose

List your collection:

bcextr api list

Pick albums and extract them straight to your library:

bcextr api choose --pattern ~/Music/{albumartist}/{album}/{title} --format flac

This opens an fzf multi-select over your collection, downloads each chosen album in the requested format, and runs it through the same extract/rename logic as bcextr extract.

In fzf there are two hot keys to keep in mind. Ctrl+a will select all and Tab will toggle a selection in the list.

--format accepts one of mp3-320, mp3-v0, flac, aac-hi, vorbis, alac, wav, aiff-lossless. If omitted, you'll get a format picker (applied to the whole batch) instead.

This relies on Bandcamp's unofficial, undocumented collection API and may break if Bandcamp changes it.

bcextr mv / bcextr cp

Reorganize an existing folder of music (searched recursively, however deep the files are nested) into a pattern-based structure. mv moves the files (the originals are gone); cp copies them, leaving the originals in place:

bcextr mv ~/Music --pattern ~/New_Music/{albumartist}/{album}/{title}
bcextr cp ~/Music --pattern ~/New_Music/{albumartist}/{album}/{title}

Pattern substitution

The pattern substitution will substitute any parameter it gets in tinytag The file extension will also be added to the end of the pattern when moving the song to it's destination

tag.album         # album as string
tag.albumartist   # album artist as string
tag.artist        # artist name as string
tag.audio_offset  # number of bytes before audio data begins
tag.bitrate       # bitrate in kBits/s
tag.comment       # file comment as string
tag.composer      # composer as string 
tag.disc          # disc number
tag.disc_total    # the total number of discs
tag.duration      # duration of the song in seconds
tag.filesize      # file size in bytes
tag.genre         # genre as string
tag.samplerate    # samples per second
tag.title         # title of the song
tag.track         # track number as string
tag.track_total   # total number of tracks as string
tag.year          # year or data as string

It is important to note that any files that are not music (in the zip, or in the source folder for bcextr mv/bcextr cp) are not moved or copied to the destination folder.

Fallback fields

Some tags (like albumartist) aren't always set. Use {fieldA,fieldB} to fall back to fieldB when fieldA is missing, and chain as many comma-separated fields as you want:

bcextr extract ~/Downloads/album.zip --pattern ~/Music/{albumartist,artist}/{album}/{title}
bcextr api choose --pattern ~/Music/{albumartist,artist,genre}/{album}/{title} --format flac

Each field is tried in order and the first one with a real value wins. If none of them have a value, it resolves to an empty string rather than erroring. Referencing an unknown field name anywhere in the group (a typo, for example) still raises the usual "Param not found" error.

Path-unsafe symbols in metadata

Before substitution, every metadata value is run through pathvalidate's replace_symbol to strip characters that would otherwise break the destination path (e.g. /, :, ?). By default these are removed entirely and spaces are left alone; pass --replacement-text to substitute something else instead, and --strip-spaces to also replace spaces:

bcextr extract ~/Downloads/album.zip --pattern ~/Music/{artist}/{album}/{title} --replacement-text "_" --strip-spaces

Metadata

Release files for bandcamp-extract 0.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bandcamp-extract 0.4.8
File Size Uploaded
bandcamp_extract-0.4.8.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bandcamp-extract 0.4.8
File Interpreter ABI Platform
bandcamp_extract-0.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 43.6 kB

Release files / bandcamp_extract-0.4.8.tar.gz

Download URL bandcamp_extract-0.4.8.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
60ff5b3345ffd4df50427f66cced85fa70935c5b722eee55bf1b25d2bd740c92
BLAKE2b-256 checksum
How to use checksums
e85cab83134901bf98c7be5ab06c1f48f0c55969d77f05c576ad9a04ecac2a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release files / bandcamp_extract-0.4.8-py3-none-any.whl

Download URL bandcamp_extract-0.4.8-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5ee7c61920e4368831594050a7eaf6b3fe9d34b85151d734b4a7c83ebd710a9
BLAKE2b-256 checksum
How to use checksums
94f3f03fa63a6787fda3c36149317653fad23f027ef485f4375a1fd51eb0aebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

This release

0.4.8 This release

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page