это мой первый пост здесь на SO.Я пытаюсь прочитать файл m4b, используя Mutagen на Python 3. Вот код, который я использую.
for file in os.listdir(workingdir):
if file.endswith('.m4b'):
workingdirectory = 'my/directory/'
commandtoexecute = ""
metadata = MP4(file)
print('read')
xa9ART1 = metadata['\xa9ART']
xa9nam1 = metadata['\xa9nam']
xa9alb1 = metadata['\xa9alb']
и вот ошибка, которую я получаю,
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 183, in _parse_esds
decSpecificInfo = ES_Descriptor.parse(fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 240, in parse
instance = cls(fileobj, length)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 278, in __init__
self.decConfigDescr = DecoderConfigDescriptor.parse(fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 240, in parse
instance = cls(fileobj, length)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 315, in __init__
self.decSpecificInfo = DecoderSpecificInfo.parse(fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 243, in parse
raise DescriptorError("descriptor parsing read too much data")
mutagen.mp4._as_entry.DescriptorError: descriptor parsing read too much data
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\mutagen\mp4\__init__.py", line 1014, in _parse_stsd
entry = AudioSampleEntry(entry_atom, entry_fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 79, in __init__
self._parse_esds(extra, fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\_as_entry.py", line 185, in _parse_esds
raise ASEntryError(e)
mutagen.mp4._as_entry.ASEntryError: descriptor parsing read too much data
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\aud.py", line 944, in <module>
my_function()
File "C:\Users\Administrator\Desktop\aud.py", line 336, in create_rar
metadata = MP4(file)
File "C:\Python37\lib\site-packages\mutagen\_file.py", line 49, in __init__
self.load(*args, **kwargs)
File "C:\Python37\lib\site-packages\mutagen\_util.py", line 140, in wrapper
return func(self, h, *args, **kwargs)
File "C:\Python37\lib\site-packages\mutagen\mp4\__init__.py", line 1061, in load
self.info.load(atoms, fileobj)
File "C:\Python37\lib\site-packages\mutagen\_util.py", line 169, in wrapper
return func(*args, **kwargs)
File "C:\Python37\lib\site-packages\mutagen\mp4\__init__.py", line 976, in load
self._parse_stsd(atom, fileobj)
File "C:\Python37\lib\site-packages\mutagen\mp4\__init__.py", line 1016, in _parse_stsd
raise MP4StreamInfoError(e)
mutagen.mp4.MP4StreamInfoError: descriptor parsing read too much data
У меня естьпопробовал это несколько раз на нескольких аудиозаписях, но мне кажется, что он застрял так.Я был бы очень рад получить помощь отсюда.
Спасибо.