├── .gitignore ├── .github └── workflows │ └── docker-image.yml ├── README.md └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | pull_request: 7 | branches: ["main"] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Set up QEMU 15 | uses: docker/setup-qemu-action@v3 16 | - name: Set up Docker Buildx 17 | uses: docker/setup-buildx-action@v3 18 | - name: Login to Docker Hub 19 | uses: docker/login-action@v3 20 | with: 21 | username: ${{ secrets.DOCKERHUB_USERNAME }} 22 | password: ${{ secrets.DOCKERHUB_TOKEN }} 23 | - name: Build and push 24 | uses: docker/build-push-action@v5 25 | with: 26 | push: true 27 | platforms: linux/amd64,linux/arm64 28 | tags: chooban/bandcamp-downloader:latest 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automated Bandcamp Downloader 2 | 3 | This is a containerised version of [Ezwen's Bandcamp Collection Downloader](https://framagit.org/Ezwen/bandcamp-collection-downloader). 4 | I wanted to run it on my docker-capable NAS, so wrapped it in a docker image based on the 5 | [linuxserver.io](https://www.linuxserver.io/) images. 6 | 7 | ## How To Run 8 | 9 | 1. Pull it from [Docker Hub](https://hub.docker.com/repository/docker/chooban/bandcamp-downloader). 10 | There are images for `arm64` and `amd64`. 11 | 12 | ``` 13 | docker pull chooban/bandcamp-downloader 14 | ``` 15 | 16 | 2. Retrieve your cookies using the options specified in the parent project. Then put them in the folder 17 | you're going to specify as the config volume (see below). 18 | 19 | 3. Run it 20 | 21 | ``` 22 | docker run \ 23 | -e PUID= 24 | -e PGID= 25 | -e BANDCAMP_USERNAME= \ 26 | -v ./config/:/bandcamp-config \ 27 | -v ./downloads/:/download \ 28 | chooban/bandcamp-downloader 29 | ``` 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic 2 | 3 | ARG BUILD_DATE 4 | ARG VERSION 5 | ARG BANDCAMP_DOWNLOADER_RELEASE 6 | 7 | ENV PYTHONIOENCODING=utf-8 8 | 9 | RUN \ 10 | echo "**** install packages ****" && \ 11 | apt-get update && \ 12 | apt-get install -y --no-install-recommends \ 13 | gnupg && \ 14 | apt-get install -y --no-install-recommends \ 15 | curl \ 16 | jq \ 17 | python3 \ 18 | python3-pip \ 19 | unzip && \ 20 | apt-get install --no-install-recommends -y \ 21 | openjdk-11-jre-headless && \ 22 | pip3 install -U --no-cache-dir pip && \ 23 | pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ \ 24 | pyppeteer && \ 25 | echo "**** install bandcamp-downloader ****" && \ 26 | if [ -z ${BANDCAMP_DOWNLOADER_RELEASE+x} ]; then \ 27 | BANDCAMP_DOWNLOADER_RELEASE=$(curl -sX GET "https://framagit.org/api/v4/projects/Ezwen%2fbandcamp-collection-downloader/releases" \ 28 | | jq -r .[0].tag_name); \ 29 | fi && \ 30 | DOWNLOADER_VER=${BANDCAMP_DOWNLOADER_RELEASE#v} && \ 31 | DOWNLOAD_URL=$(curl -sX GET "https://framagit.org/api/v4/projects/Ezwen%2fbandcamp-collection-downloader/releases" \ 32 | | jq -r .[0].assets.links[0].url) && \ 33 | echo "**** downloading ${DOWNLOADER_VER} ****" && \ 34 | mkdir -p /app/bandcamp-downloader/ && \ 35 | curl -o \ 36 | /app/bandcamp-downloader/bandcamp-downloader.jar -L \ 37 | "${DOWNLOAD_URL}" && \ 38 | apt-get clean autoclean && \ 39 | apt-get autoremove --yes && \ 40 | rm -rf /var/lib/apt/lists/* 41 | 42 | VOLUME /bandcamp-config 43 | VOLUME /download 44 | 45 | ENV BANDCAMP_USERNAME=noname 46 | ENV FORMAT=flac 47 | ENV COOKIES_FILE=cookies.json 48 | 49 | CMD java -jar /app/bandcamp-downloader/bandcamp-downloader.jar \ 50 | --cookies-file=/bandcamp-config/$COOKIES_FILE \ 51 | --download-folder=/download \ 52 | --audio-format=$FORMAT \ 53 | $BANDCAMP_USERNAME 54 | 55 | --------------------------------------------------------------------------------