From 96ec691dc53a278c747440854d0dcfd437ab43a1 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sun, 1 Feb 2026 10:48:56 +0100 Subject: [PATCH] embed audio metadata --- hosts/darwin/imac/home.nix | 7 +++++-- modules/yt-dlp.nix | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hosts/darwin/imac/home.nix b/hosts/darwin/imac/home.nix index 4e69ddb..ecaefc8 100644 --- a/hosts/darwin/imac/home.nix +++ b/hosts/darwin/imac/home.nix @@ -3,8 +3,11 @@ { imports = [ ../home-default.nix + ../../../modules/yt-dlp.nix ]; - # MacBook-specific home configuration - # Example: Laptop-specific tools, power management, etc. + programs.yt-dlp-custom = { + enable = true; + downloadDir = "~/Downloads"; + }; } diff --git a/modules/yt-dlp.nix b/modules/yt-dlp.nix index 52fa04e..311e384 100644 --- a/modules/yt-dlp.nix +++ b/modules/yt-dlp.nix @@ -48,9 +48,7 @@ in # Download options --no-playlist --embed-thumbnail - --write-thumbnail - --write-description - --write-info-json + --no-embed-chapters # Error handling --ignore-errors @@ -282,7 +280,7 @@ in mkdir -p "$DOWNLOAD_DIR" if [[ "$audio_only" == true ]]; then echo "Downloading $platform_name audio..." - echo "Output directory: $DOWNLOAD_DIR/$platform_name-Audio" + echo "Output directory: $DOWNLOAD_DIR/$platform_name-audio" else echo "Downloading $platform_name video..." echo "Output directory: $DOWNLOAD_DIR/$platform_name" @@ -292,7 +290,7 @@ in # Build format string for audio-only or resolution limit local format_string="" if [[ "$audio_only" == true ]]; then - format_string="--format 'bestaudio[ext=m4a]/bestaudio/best' --extract-audio --audio-format m4a" + format_string="--format 'bestaudio[ext=m4a]/bestaudio/best' --extract-audio --audio-format m4a --embed-metadata --parse-metadata '%(uploader)s:%(meta_album)s' --parse-metadata '%(uploader)s:%(meta_album_artist)s'" elif [[ -n "$max_resolution" ]]; then format_string="--format 'bestvideo[ext=mp4][height<=$max_resolution]+bestaudio[ext=m4a]/best[ext=mp4][height<=$max_resolution]/best'" fi