# Extracts audio from YouTube videos, converts it to mp3, and adds audio tags to it.
configuration:
  working_directory: '.ytdl-sub-downloads'

presets:
  song:
    download:
      download_strategy: "url"
      url: "{url}"

    output_options:
      output_directory: "{music_directory}"
      file_name: "{custom_track_name_sanitized}.{ext}"

    audio_extract:
      codec: "mp3"
      quality: 128

    music_tags:
      tags:
        artist: "{custom_artist_name}"
        albumartist: "{custom_artist_name}"
        title: "{custom_track_name}"
        album: "{custom_album_name}"
        track: "{custom_track_number}"
        year: "{upload_year}"
        genre: "Unset"

    overrides:
      music_directory: "/path/to/music"
      custom_track_name: "{title}"
      custom_album_name: "Singles"
      custom_artist_name: "{channel}"
      custom_track_number: "1"

  #  TODO: make a playlist of individual songs into an album. Need playlist_title
  song_playlist:
    preset: "song"
    overrides:
      custom_track_number: "{playlist_index}"

  album_from_chapters:
    preset: "song"
    output_options:
      file_name: "{custom_album_name_sanitized}/{chapter_index_padded} - {custom_track_name_sanitized}.{ext}"
      thumbnail_name: "{custom_album_name_sanitized}/folder.{thumbnail_ext}"

    chapters:
      embed_chapters: True

    split_by_chapters:
      when_no_chapters: "pass"

    overrides:
      custom_track_name: "{chapter_title}"
      custom_album_name: "{title}"  # Have the video name be the album
      custom_track_number: "{chapter_index}"
