'ncon', # ?
'pcnt', # play counter (incremented with each play)
'priv', # private
+ 'tco', # content type
+ 'tcp', # frame?
'tenc', # encoded by
'tflt', # file type
'tope', # original artist (e.g. for a cover)
'tmed', # media type
'wxxx', # user defined URL
]
+ key_translations = {
+ 'com': 'comm',
+ 'ten': 'tenc',
+ 'tal': 'talb',
+ 'tcm': 'tcom',
+ 'tt2': 'tit2',
+ 'tp1': 'tpe1',
+ 'trk': 'trck',
+ 'tye': 'tyer',
+ }
in_v2 = False
for line in stdout.splitlines():
if not in_v2:
in_v2 = True
continue
key,value = [x.strip() for x in line.split(':', 1)]
- short_key = key.split()[0]
- if short_key.lower() in drop_keys:
+ if value.lower() == 'no id3v1 tag':
+ continue
+ short_key = key.split()[0].lower()
+ short_key = key_translations.get(short_key, short_key)
+ if short_key in drop_keys:
continue
- v_key = vorbis_keys[short_key.lower()]
+ v_key = vorbis_keys[short_key]
if v_key == 'genre':
value = value.rsplit('(', 1)[0].strip()
elif v_key == 'tracknumber' and '/' in value: