I am trying to use youtube-dl to download some youtube video sound as mp3 and embed the thumbnail as well. But i get the following error every time i try:
thumbnail_filename = info['thumbnails'][-1]['filename'] KeyError: 'filename'
Here is my youtube-dl options
ydl_opts = {
'key':'IgnoreErrors',
'format': 'bestaudio/best',
'download_archive': self.songs_data,
'outtmpl': '/'+download_path+'/'+'%(title)s.%(ext)s',
'progress_hooks': [self.my_hook],
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192'},
{'key': 'EmbedThumbnail'},]}
Any ideas why? embed thumbnail does not have any arguments.
Thank you
info['thumbnails'][-1].keys()
? – Flavor