0

how can i add artist title date etc. to variables?

from ffprobe import FFProbe

metadata = FFProbe("01-leo_lausemaus_-_leo_lausemaus_titelsong.mp3")
print(metadata)

output results its:

<FFprobe: {'title': 'Leo Lausemaus Titelsong', 'artist': 'Leo Lausemaus', 'track': '1/0', 'album': 'Folge 1', 'disc': '1', 'date': '2015', 'TLEN': '78', 'album_artist': 'Leo Lausemaus', 'Duration': '00:01:18.99', 'start': '0.025056', 'bitrate': '329 kb/s'}, [<Stream: #1 [video] Motion JPEG, 0, (512x512)>], [<Stream: #0 [audio] MP3 (MPEG audio layer 3), channels: 2 (stereo), 44100Hz> ], [], []>

I want to be able to output each variable individually

I use python 3.8 on windows.

Regards

wjandrea
  • 28,235
  • 9
  • 60
  • 81
kuck
  • 97
  • 6
  • 1
    Have you tried a `dir(metadata)`? That should give you some hints as to what methods and attributes are available. – Mortz Apr 11 '20 at 18:51
  • unfortunately i don't know how to do that, can you tell me how i can? – kuck Apr 11 '20 at 19:09

1 Answers1

0

From reading the source, the metadata you're seeing in the repr is an instance attribute, metadata, which is a dict. So to get the title for example:

metadata.metadata['title']
wjandrea
  • 28,235
  • 9
  • 60
  • 81