Files
MeDBia/scanner/README.md
Malin 6002fc6e58 feat: add macOS disc scanner + API ingest endpoint
- scanner/scan_disc.py: polls optical drive via drutil, detects disc type
  (DVD/Blu-ray/Audio CD/Data CD), reads volume label, file/track count,
  posts to remote API, auto-ejects. Pure Python + requests, no drivers.
- scanner/requirements.txt + README.md: setup and usage docs
- videodb/api_ingest.php: authenticated POST endpoint that writes disc
  records directly into the videoDB MySQL schema; token stored in config
- docker-compose.yml: adds INGEST_API_TOKEN env var
- docker-entrypoint.sh: writes ingest_api_token into config.inc.php

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

2.4 KiB

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.