Hey,
I’m trying to use acoustid through the code at https://github.com/beetbox/pyacoustid
However i’m only getting track name and artist names, how can I get all the available metadata for a song?
Thanking you,
Aditya
Hey,
I’m trying to use acoustid through the code at https://github.com/beetbox/pyacoustid
However i’m only getting track name and artist names, how can I get all the available metadata for a song?
Thanking you,
Aditya
You need to use the returned recording ID with a MusicBrainz API client to get the rest of the metadata. Not a Python programmer, though, so I’m afraid my attempt to point you to one would be no better than Google (which returns several).
Ah okay, Thanks man
But i’m still a bit confused, if anyone could help me out it’d be great!
@adityamenon: If you have pyacoustid
and musicbrainzngs
I guess something like that should work (my code should be py2/py3 compatible):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pprint import pprint
import acoustid
import musicbrainzngs
# replace by your own
API_KEY = 'cSpUJKpD'
# replace by your own
musicbrainzngs.set_useragent("loujine-test", "0.0.1",
"https://community.metabrainz.org/t/retrieve-all-metadata/342396")
# replace
filename = "..."
for result in acoustid.match(API_KEY, filename):
mbid = result[1]
print(mbid)
recording = musicbrainzngs.get_recording_by_id(mbid, includes=['artists', 'releases', 'media'])
pprint(recording)
Here recording
should contain the JSON data