0

私は eyed3 を使用して作業しましたが、これらのファイルを開くことができないため、クラッシュするid3ような特殊文字を含むファイルをロードするたびに..."ü"

それが私がミュータジェンに切り替えた理由です。ライブラリ全体でアルバム アートを確認したい。

#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()

これが「効く」。アルバム アートのないファイルを取得しますがアルバム アートのあるファイルも取得します。

なにが問題ですか?

4

1 に答える 1

0

私はそれを考え出した。

pict_test関数を次のように変更しました。

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
于 2014-03-23T17:49:56.463 に答える