File: test_tags

package info (click to toggle)
mp3fs 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 888 kB
  • sloc: cpp: 1,884; ansic: 564; sh: 298; makefile: 82
file content (36 lines) | stat: -rwxr-xr-x 612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

. "${BASH_SOURCE%/*}/funcs.sh"

get_metadata() {
    python3 <<END
import mutagen
file = mutagen.File('$1')
tags = ['%s=%s' % (k, v) for k, v in file.tags.items() if k[0] == 'T']
print('\n'.join(sorted(tags)))
END
}

cmp -s - <(get_metadata "$DIRNAME/obama.mp3") <<END
TALB=US State of the Union 2011
TCON=Spoken
TCOP=Public Domain
TDRC=2011-01-25
TIT2=The Internet [excerpt]
TLEN=6000
TPE1=Barack Obama
TPOS=0/0
TRCK=1/1
TSSE=MP3FS
END

cmp -s - <(get_metadata "$DIRNAME/ra[ven].mp3") <<END
TALB=The Raven
TCON=Speech
TDRC=2007
TIT2=the_raven
TLEN=20970
TPE1=Edgar Allen Poe
TRCK=01
TSSE=MP3FS
END