embed audio metadata
This commit is contained in:
parent
53d7bf16ec
commit
96ec691dc5
2 changed files with 8 additions and 7 deletions
|
|
@ -3,8 +3,11 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../home-default.nix
|
../home-default.nix
|
||||||
|
../../../modules/yt-dlp.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# MacBook-specific home configuration
|
programs.yt-dlp-custom = {
|
||||||
# Example: Laptop-specific tools, power management, etc.
|
enable = true;
|
||||||
|
downloadDir = "~/Downloads";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,7 @@ in
|
||||||
# Download options
|
# Download options
|
||||||
--no-playlist
|
--no-playlist
|
||||||
--embed-thumbnail
|
--embed-thumbnail
|
||||||
--write-thumbnail
|
--no-embed-chapters
|
||||||
--write-description
|
|
||||||
--write-info-json
|
|
||||||
|
|
||||||
# Error handling
|
# Error handling
|
||||||
--ignore-errors
|
--ignore-errors
|
||||||
|
|
@ -282,7 +280,7 @@ in
|
||||||
mkdir -p "$DOWNLOAD_DIR"
|
mkdir -p "$DOWNLOAD_DIR"
|
||||||
if [[ "$audio_only" == true ]]; then
|
if [[ "$audio_only" == true ]]; then
|
||||||
echo "Downloading $platform_name audio..."
|
echo "Downloading $platform_name audio..."
|
||||||
echo "Output directory: $DOWNLOAD_DIR/$platform_name-Audio"
|
echo "Output directory: $DOWNLOAD_DIR/$platform_name-audio"
|
||||||
else
|
else
|
||||||
echo "Downloading $platform_name video..."
|
echo "Downloading $platform_name video..."
|
||||||
echo "Output directory: $DOWNLOAD_DIR/$platform_name"
|
echo "Output directory: $DOWNLOAD_DIR/$platform_name"
|
||||||
|
|
@ -292,7 +290,7 @@ in
|
||||||
# Build format string for audio-only or resolution limit
|
# Build format string for audio-only or resolution limit
|
||||||
local format_string=""
|
local format_string=""
|
||||||
if [[ "$audio_only" == true ]]; then
|
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
|
elif [[ -n "$max_resolution" ]]; then
|
||||||
format_string="--format 'bestvideo[ext=mp4][height<=$max_resolution]+bestaudio[ext=m4a]/best[ext=mp4][height<=$max_resolution]/best'"
|
format_string="--format 'bestvideo[ext=mp4][height<=$max_resolution]+bestaudio[ext=m4a]/best[ext=mp4][height<=$max_resolution]/best'"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue