In the interest of keeping this at the top discussion level, here's the detail (pain-in-the-ass forum software strips carriage returns on paste, and removes all blank lines on post).
Dockerfile
FROM debian:stable-slim # Install base tools to support firefox ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y --no-install-recommends \ libgtk-3-0 gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \ libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 \ libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 \ libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxt6 libxtst6 \ ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget ffmpeg # Create a base environment to work RUN set -xe && mkdir -p /output /cookies /app /root/.cache VOLUME /output /cookies /root/.cache ENV PATH="/app:${PATH}" ENV LANG="en_US.UTF8" # Setup the executable/script WORKDIR /app COPY jav-it jav-it COPY dictionary.csv dictionary.csv COPY jav-it.sh jav-it.sh RUN chmod 555 /app/* # Run the process script ENTRYPOINT ["/app/jav-it.sh"]
jav-it.sh
#!/bin/bash CONTENTID=$1 FILENAME=$2 # Default - don't keep temp files KEEP="${keep_temp:=false}" # Default - use mkv for the container EXT="${container:=mkv}" TMP="/tmp/jav-it" download() { # Download video from R18 and decrypt to *.ts /app/jav-it download -c /cookies/cookies.txt -i $1 -o "$TMP" } transcode() { # Convert a list of *.ts files to a single mkv ffmpeg -f concat -safe 0 -i "$TMP/$1-parts.txt" -c copy -bsf:a aac_adtstoasc "/output/$2.$3" } # Attempt to download the video mkdir -p "$TMP" if download $CONTENTID; then # If successful, list all *.ts files and pass them to ffmpeg for transcoding for i in `ls "$TMP/$CONTENTID"*.ts | sort -V`; do echo "file '$i'"; done >> "$TMP/$CONTENTID-parts.txt" transcode $CONTENTID $FILENAME $EXT # Check whether we should keep the intermediate files if [[ $KEEP != 'false' ]]; then mv "$TMP/"* /output/ fi fi
docker-compose.yml
version: "3" services: jav-it: build: . image: jav-it/jav-it container_name: jav-it # environment: # keep_temp: 'true' # container: 'mkv' volumes: - ./output:/output - ./cookies:/cookies - cache:/root/.cache labels: com.centurylinklabs.watchtower.enable: false volumes: cache:
Once these are all saved in a directory along with the jav-it binary and dictionary.csv:
docker-compose build mkdir output cookies # Move your cookies file to cookies/cookies.txt # docker-compose run --rm jav-it <contentid> <filename> docker-compose run --rm jav-it 1atom00150 ATOM-150
If all went well (and works like it does on my machine - obligatory "Docker: We'll ship your machine" meme), then it will download its dependencies to the cache volume, download the streams one by one to a temp dir, and finally ffmpeg them together into a single MKV in the output directory, then remove the container and temp files.