0

I used eyed3 to work with id3 but everytime I want to load a file with a special character like "ΓΌ" it crashes because it cannot open these files...

That's why I switched to mutagen. I want check my whole library for album art.

#pict_test function

def pict_test(filepath):
    audio = File( filepath )

    if 'covr' in audio or 'APIC:' in audio:
        return True

    return False

#main
filepath = "/home/jds/Desktop/M_M/"

#get all files in this directory including sub directories
files = getFiles.get_all_files( filepath ) 
files = getMp3Files( files )

print "%d mp3 files found.\n" % ( len(files) )
f = open( "No Img.txt", "w" )
for f in files:
    if not pict_test( f ): #if no image is found write filepath to file
        f.write( f + "\n" )
f.close()

This "works". I get files without album art BUT also files with album art.

What is wrong?

0

I figured it out.

I changed the pict_test function into this :

def pict_test(filepath):
    audio = File( filepath )
    for k in audio.keys():
        if u'covr' in k or u'APIC' in k:
            return True

    return False

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.