Comments (5)
Hello @ktkchn,
thanks for reporting! Can you please upload the mp4 file somewhere so i can reproduce the bug? thanks!
from tinytag.
hello @devsnd
I have uploaded the m4a file here
https://drive.google.com/file/d/0B4rXGVsThTq6UjBEcjZCX29aWFU/view?usp=sharing
thanks
complete error traceback:
Traceback (most recent call last):
File "makedb.py", line 39, in
tag=TinyTag.get(fp)
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 99, in get
tag.load(tags=tags, duration=duration, image=image)
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 116, in load
self._parse_tag(self._filehandler)
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 307, in _parse_tag
return self._traverse_atoms(fh, path=self.META_DATA_TREE)
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 331, in _traverse_atoms
curr_path=curr_path + [atom_type])
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 331, in _traverse_atoms
curr_path=curr_path + [atom_type])
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 331, in _traverse_atoms
curr_path=curr_path + [atom_type])
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 331, in _traverse_atoms
curr_path=curr_path + [atom_type])
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 331, in _traverse_atoms
curr_path=curr_path + [atom_type])
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 334, in _traverse_atoms
for fieldname, value in sub_path(fh.read(atom_size)).items():
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 211, in parse_data_atom
return {fieldname: conversion(data_atom[8:])}
File "/usr/lib/python2.6/site-packages/tinytag/tinytag.py", line 180, in
1: lambda x: codecs.decode(x, 'utf-8'), # UTF-8
File "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 34: invalid start byte
from tinytag.
Hey @ktkchn,
I have reproduced the bug and also found out why TinyTag crashes; The file you provided is malformed and does not adhere to the spec. Apples specification for MP4 allows strings only to be encoded using UTF-8. The file you provided seems to use ISO-8859-1 (also called latin1). Since there is no way to find out which encoding a byte-sequence was encoded in, I cannot just decode your file in a different manner.
I have added a patch that will replace all characters that cannot be decoded with �
, so that TinyTag will not crash anymore.
from tinytag.
I have released a new version 0.15.2 that includes this fix.
from tinytag.
thank you!
from tinytag.
Related Issues (20)
- Feature Request: Adding Song Titles HOT 2
- [BUG] AIFF text should be treated as UTF-8 HOT 2
- [BUG] Incorrect bitrate and duration for VBR mp3s HOT 5
- [BUG] UnicodeDecodeError on valid MP3 file
- Make use of code linting HOT 1
- How to handle filebuffer instead of filenames
- [BUG] Some mp3 files report 1/2 of actual duration HOT 2
- Some MP3‘s genre cannot be read correctly since v1.8.0
- [Question] - detect image encoding / format HOT 1
- tag artist, quando adicionado mais de um artista a string fica mal formatada. HOT 1
- [BUG] struct.error: unpack requires a buffer of 4 bytes HOT 8
- [BUG] Parsing mp3 file w/ valid TDRC tag does not populate year HOT 4
- Replace deprecated aifc module HOT 3
- [BUG] TDRC tag not captured as "year" HOT 2
- [BUG] Can't read `extra` tags from .m4a files HOT 1
- Expose a list of supported file extensions HOT 4
- Fail to read track_total, but it is ok in foobar
- asyncio interfaces HOT 3
- [BUG] Incompatibility with Python-pip HOT 2
- [BUG] `tags.year` is null although the MP3 file has the year set HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinytag.