How can I get banner art, artist name and the song name from a .mp3 file using python?

349 Views Asked by At

**

I want to make a music app and I am successful in getting the songs and playing them using SoundLoader from kivy.core.audio

I also added them in a OneLineIconList item BUT I can't figure out how to get the album art/banner art, artist name, song name and the duration of the song using only python

And also is it possible to get it all offline. If yes, so can you please give me the code for that


THANK YOU IN ADVANCE

**

1

There are 1 best solutions below

0
On
import os

st = os.stat("file.dat")

This function takes the name of a file, and returns a 10-member tuple with the following contents:

(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)

Here's a short example of the usage:

import os, time
from stat import * # ST_SIZE etc

try:
    st = os.stat(file)
except IOError:
    print "failed to get information about", file
else:
    print "file size:", st[ST_SIZE]
    print "file modified:", time.asctime(time.localtime(st[ST_MTIME]))

Source: http://effbot.org/zone/python-fileinfo.htm