Skip to main content

How to fix poor YouTube video quality downloads with Karakeep

I installed Karakeep as a bookmarks manager. It works great so far! However, when I tried to bookmark a YouTube video, the video quality was awful.

yt-dlp is the tool used under-the-hood to process the video downloads.

I tried to play with some environment variables to force a better resolution download, unsuccessfully…

CRAWLER_VIDEO_DOWNLOAD=true
CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1
CRAWLER_YTDLP_ARGS="-S ext"

It turns out that yt-dlp needs ffmpeg which is not installed in the official Docker image.

You will need to use your own custom image to add ffmpeg.

Create a file named Dockerfile next the compose.yaml file with the following content:

ARG KARAKEEP_VERSION=release
FROM ghcr.io/karakeep-app/karakeep:${KARAKEEP_VERSION}

RUN apt-get update \
    && apt-get -y install ffmpeg --no-install-recommends \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

Then, in the compose.yaml file, instead of using Karakeep’s official Docker image, use your own Dockerfile instead:

# compose.yaml
services:
  web:
-    image: ghcr.io/karakeep-app/karakeep:${KARAKEEP_VERSION:-release}
+    build:
+      context: "." # Path to where you stored your Dockerfile ("." means it is stored in the same folder as the `compose.yaml` file)
+      args:
+        KARAKEEP_VERSION: "0.31.0" # If you want to fix a specific version of Karakeep (default to "release")

Now, yt-dlp will download videos with the best quality.