[Python] Results of Python eyeD3 Program Not Reflected in Microsoft Explorer

Discussão em 'Python' iniciado por Stack, Março 23, 2025.

  1. Stack

    Stack Membro Participativo

    I'm running Python 3.12 on Windows 10 using Visual Studio Code version 1.98.2. The python program calling eyeD3 runs OK most of the time when Metadata is version 2, 3, 0 or better.

    However, after running my program with no errors, when I go back to Explorer, and the old Metadate is still there even after a refresh. But, when I run Mp3Tag program, the information appears to be gone in Mp3Tag but isn't really gone in Explorer. Only when I change the Metadate in Mp3Tag, the Metadata is then gone in the Explorer list.

    I have some 13,000 MP3 to change so I can't be going to Mp3Tag (takes too long).

    What am I missing in my Python/eyeD3 program where changes to the Metadata are not showing in the Explorer listing?

    Should I be using another process?

    My code

    import os
    import eyed3

    # Assign directory
    directory = r"C:\Users\bill\Music\Creedence Clearwater Revival"

    print('starting ')
    print('NOW *** ')

    # Iterate over files in directory
    for name in os.listdir(directory):
    # Open file
    with open(os.path.join(directory, name)) as f:
    print(f"Content of '{name}'")

    audiofile = eyed3.load(directory + '\\' + str(name))

    if ".mp3" in str(name):
    print('Version --- ' + str(audiofile.tag.version))
    #if audiofile.tag.version == "(2, 4, 0)":
    # Modify the metadata.
    editFlag = 0
    if audiofile.tag.album:
    print('album ----> ' + str(audiofile.tag.album))
    audiofile.tag.album = None
    editFlag = 1

    if audiofile.tag.track_num:
    print('Trk_Nm ---> ' + str(audiofile.tag.track_num))
    audiofile.tag.track_num = None
    editFlag = 1

    if audiofile.tag.disc_num:
    print('Discnumber -- ' + str(audiofile.tag.disc_num))
    audiofile.tag.disc_num = None
    editFlag = 1

    #Save changes.

    if editFlag == 1:
    print('Edited --> ' + str(name))
    audiofile.tag.save()

    Continue reading...

Compartilhe esta Página