I have a problem that confused me. I want to get metadata (especially genre, artist) in python and I've tried some way to do this but each of them return null
.
I want to get at least one feature (genre, artist) and connect it Spotify or Last.fm api to get information about the raw mp3 file and choose the other file in library for mixing.
Here some code that I tried:
from tinytag import TinyTag
file2 = "/home/orhanors/Desktop/music/yokohama.mp3"
a_tag = TinyTag.get(file2)
print(a_tag)
Result:
{"album": null, "albumartist": null, "artist": null, "audio_offset": 138, "bitrate": 192, "channels": 2, "comment": null, "composer": null, "disc": null, "disc_total": null, "duration": 417.604742145821, "filesize": 10017364, "genre": null, "samplerate": 44100, "title": null, "track": null, "track_total": null, "year": null}
import eyed3
audio = eyed3.load(file2)
print(audio.tag.artist)
print(audio.tag.album)
print(audio.tag.title)
Result:
None
None
None