leosongwei / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

OGG with ID3 tag can't get read #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I try to load a OGG file that is erroneously tagged with an ID3 tag, 
mutagen can't proceed.

E: 3075794624 12:51:42 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/picard/util/thread.py", line 80, in generic_run_item
    result = func()
  File "/usr/lib/python2.7/site-packages/picard/formats/vorbis.py", line 37, in _load
    file = self._File(encode_filename(filename))
  File "/usr/lib/python2.7/site-packages/mutagen/__init__.py", line 75, in __init__
    self.load(filename, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mutagen/ogg.py", line 441, in load
    self.info = self._Info(fileobj)
  File "/usr/lib/python2.7/site-packages/mutagen/oggvorbis.py", line 41, in __init__
    page = OggPage(fileobj)
  File "/usr/lib/python2.7/site-packages/mutagen/ogg.py", line 87, in __init__
    oggs, "OggS", fileobj.tell() - 27))
OggVorbisHeaderError: read 'ID3\x04', expected 'OggS', at 0x0

Original issue reported on code.google.com by ludwig-c...@gmx.de on 9 Aug 2011 at 11:03

GoogleCodeExporter commented 9 years ago
This is not a mutagen problem; it's a limitation with how it's being used. 
Firstly the file is invalid: it is not an ogg file anymore. Secondly, the File 
helper takes some indicators from the filename which claim the file is an ogg.

You can fix the file with something like mutagen.id3.ID3(yourfile).delete() 
(see http://code.google.com/p/mutagen/wiki/Tutorial)

Original comment by mur...@gmail.com on 9 Aug 2011 at 12:43