Ejemplo n.º 1
0
 def get_id3():
     try:
         size = tags.get_tag_size('private-id3v2-frame')
         for i in range(0, size):
             (exists,
              sample) = tags.get_sample_index('private-id3v2-frame', i)
             if not exists:
                 continue
             (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
             if not exists:
                 continue
             string = decode_all(m.data)
             if string.startswith('USLT'):
                 split = string.split('\x00')
                 return split[-1:][0]
     except Exception as e:
         print("TagReader::get_id3()", e)
     return ""
Ejemplo n.º 2
0
 def get_id3():
     try:
         size = tags.get_tag_size("private-id3v2-frame")
         for i in range(0, size):
             (exists,
              sample) = tags.get_sample_index("private-id3v2-frame", i)
             if not exists:
                 continue
             (exists, m) = sample.get_buffer().map(Gst.MapFlags.READ)
             if not exists:
                 continue
             string = decode_all(m.data)
             if string.startswith("USLT"):
                 split = string.split("\x00")
                 return "".join(split[5:-1])
     except Exception as e:
         print("TagReader::get_id3()", e)
     return ""