Open clustor opened 3 years ago
strings_to_match = ["xxxx", "yyyy"] for fid in list(audiofile.tag.frame_set): if fid.startswith(b"T") or fid.startswith(b"TX"): if audiofile.tag.getTextFrame(fid) in strings_to_match: del audiofile.tag.frame_set[fid]
This works for b"T", but not b"TX". The latter are user text frames and there may multiple TXXX frames, but the descriptions must be unique. So, this room removes all TXXX .
What's the recommended way to iterate through the tags present in an mp3 and remove all the tags if there is an exact match to a string?
Currently I am reviewing text frames, URL tags and comments on a case by case basis. This is ok but not the cleanest solution for a generic approach.
On a related note, is there a way to remove all tags excluding certain ones programmatically?