Files
MeDBia/scanner
Malin 451afc0440 fix: add libonig-dev for mbstring; update scanner for data discs
Dockerfile: add libonig-dev (oniguruma) — required by mbstring extension

scanner/scan_disc.py:
- Treat all discs as data discs (mp4/mkv/etc), no VIDEO_TS/BDMV logic
- List video files by extension (.mp4 .mkv .avi .mov .m4v .ts .m2ts …)
- Infer media type from drutil type string, fall back to used_gb capacity
  (>8 GB → Blu-ray, >0.68 GB → DVD, smaller → CD)
- Store video file names in comment field, count in custom2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:12:34 +02:00
..

MeDBia Disc Scanner (macOS)

Runs on your Mac — polls the optical drive, reads the disc, sends the record to the remote Docker stack, ejects.

One-time setup

# Install Python dependency
pip3 install requests

# Set your server URL and the API token from docker-compose.yml
export VIDEODB_URL=http://your-server:6761
export VIDEODB_TOKEN=change_this_secret_token

Run

cd scanner
python3 scan_disc.py

Then insert discs one by one. Each disc is:

  1. Detected (polled every 5 s)
  2. Read — volume label, disc type, size, file/track count
  3. Submitted to the remote videoDB
  4. Ejected automatically

Environment variables

Variable Default Description
VIDEODB_URL http://your-server:6761 Base URL of the Docker stack
VIDEODB_TOKEN change_this_secret_token Must match INGEST_API_TOKEN in docker-compose.yml
POLL_INTERVAL 5 Seconds between drive checks

What gets indexed per disc

Field Source
Title Volume label (disc name as burned)
Media type Auto-detected: DVD / Blu-ray / CD
Comment Track count (audio) or file count (data)
File size Total used space on disc
Custom 1 Raw drutil type string
Custom 2 Track or file count (number only)

All entries are immediately visible and searchable in the videoDB web UI at http://your-server:6761.

macOS permissions

If macOS asks for permission to control the disc drive or access /Volumes/, allow it. The script uses drutil, diskutil, and df — all standard macOS CLI tools, no third-party drivers needed.

Blu-ray note

macOS does not include a Blu-ray filesystem driver by default. Blu-ray discs will show as unreadable in Finder but drutil status will still report BD-ROM. The scanner will detect the type from drutil and index it, but file listing will be unavailable. Volume label may show as the device node instead of the disc name in that case — you can edit the entry in the web UI afterwards.