Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't add_tags to MP4? #334

Closed
elelay opened this issue Jan 1, 2018 · 2 comments
Closed

can't add_tags to MP4? #334

elelay opened this issue Jan 1, 2018 · 2 comments

Comments

@elelay
Copy link

@elelay elelay commented Jan 1, 2018

When trying to add tags to a downloaded MP4, I get an AttributeError: 'MP4Tags' object has no attribute '_padding'.
The code is part of gPodder but here is a reproducible example:

>>> import mutagen
>>> f=mutagen.File("white noise.mp4", easy=True)
>>> f
{}
>>> f.info.pprint()
'MPEG-4 audio (AAC LC), 5.06 seconds, 96392 bps'
>>> f.tags
>>> f.add_tags()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/mutagen/mp4/__init__.py", line 1088, in add_tags
    self.tags = self.MP4Tags()
  File "/usr/lib/python3.6/site-packages/mutagen/easymp4.py", line 45, in __init__
    self._padding = self.__mp4._padding
AttributeError: 'MP4Tags' object has no attribute '_padding'
>>> f.tags['album'] = 'Hello'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object does not support item assignment

Video is at croco.elelay.fr/dropbox/white%20noise.mp4 (http)

python 3.6.3
ArchLinux
mutagen 1.39

@lazka lazka closed this in dd941a9 Jan 1, 2018
@lazka

This comment has been minimized.

Copy link
Member

@lazka lazka commented Jan 1, 2018

Thanks.

Workaround:

from mutagen.mp4 import MP4Tags
MP4Tags._padding = 0

(This value is only used during testing, so it's unlikely to be a problem in the future)

@elelay

This comment has been minimized.

Copy link
Author

@elelay elelay commented Jan 1, 2018

great, thanks for the quick fix and workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.