I'm trying to download a song from YouTube and write the artist's name to the metadata. embed-metadata takes care of this most of the time, but in some cases, the uploader isn't the same as the artist.
import yt_dlp
def download(song, url):
ydl_opts = {
'format': 'm4a/bestaudio/best',
'verbose': True,
'outtmpl': (song + ".%(ext)s"),
'merge-output-format': 'mkv',
'embed-metadata': True,
'parse-metadata': '%(artist)s - %(title)s',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'aac'
},
{
'key': 'FFmpegMetadata'
}
]
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download(url)
download('Daniel Pemberton - Falling Apart',
'https://www.youtube.com/watch?v=Uhx77_beiso&pp=ygUNZmFsbGluZyBhcGFydA%3D%3D')
This specific song's uploader on YouTube is SonySoundtracksVevo, but I want to change it to Daniel Pemberton, the name of the artist. Is there anyway to do this with yt-dlp? I've already tried 'parse-metadata': '%(artist)s - %(title)s' but the artist name is still incorrect.