# Use yt-dlp the correct way for music files

Use:

`-f bestaudio `  
`-f ba --extract-audio --audio-format flac`

for best audio quality.

`-o "%(title)s.%(ext)s"`

for correct naming of the files.

`--add-metadata`

for correct IDs.

`--parse-metadata "playlist_index:%(track_number)s" `

for parsing track numbers.

`--embed-thumbnail `

This instructs yt-dlp to embed the thumbnail image in the downloaded audio file.

You can use youtube URLS to download complete album in one go:

`#yt-dlp -f bestaudio -o "%(title)s.%(ext)s" --add-metadata  --parse-metadata "playlist_index:%(track_number)s"  `[`https://www.youtube.com/playlist?list=OLAK5uy_nBJgNLqUL8A64tQMKFNPK3x7KzNOgfbUw`](https://www.youtube.com/playlist?list=OLAK5uy_nBJgNLqUL8A64tQMKFNPK3x7KzNOgfbUw)

# Embed thumbnail in opus music files

`#ffmpeg -i audio_file.opus -i thumbnail.jpg -c:v mjpeg -c:a copy -metadata:s:v title="Album Art" output_file.opus`