Git Product home page Git Product logo

Comments (4)

phw avatar phw commented on June 19, 2024

If there are no ID3v2.x tags yet mutagen does not automatically add them. You need to do some check like:

if audio.tags is None:
    audio.add_tags()

from mutagen.

unikitty37 avatar unikitty37 commented on June 19, 2024

Thanks, but the file already has ID3v2 tags (as shown in the example output). Adding a print(mutagen.File(filename).tags.pprint()) just before audio = ID3(filename) produces this:

COMM==eng=This is a comment
COMM=ID3v1 Comment=eng=This is a comment
TALB=Programme Name - Series 01
TCON=Comedy
TDRC=1922
TIT2=Programme Name
TPE1=Programme Name
TPE2=Programme Name
TRCK=1

In any case, audio.tags doesn't seem to be the right thing:

Traceback (most recent call last):
  File "/Users/me/bin/retag.py", line 18, in <module>
    if audio.tags is None:
AttributeError: 'ID3' object has no attribute 'tags'

from mutagen.

phw avatar phw commented on June 19, 2024

@unikitty37 The issue seems to be not writing the file, but the verification with the id3v2 utility, which does not support ID3v2.4. Either verify with e.g. mutagen-inspect or another tool actually supporting v2.4 tags, or save v2.3 tags by passing v2_version=3 to the save call.

from mutagen.

phw avatar phw commented on June 19, 2024

I am closing this. I tried your script directly and it does save the ID3v2.4 tags. The old id3v2 utility does not support that. Saving with v2_version=3 makes it visible in that utility as well.

(BTW, shouldn't that v2 parameter in the list be v2_version? :)

Docs are fixed with 3cbcc1b

from mutagen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.