Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mutagen/mp3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,11 @@ def mime(self):
def score(filename, fileobj, header_data):
filename = filename.lower()

return (header_data.startswith(b"ID3") * 2 +
return ((header_data.startswith(b"ID3") or
header_data.startswith(b'\xFF\xF2') or
header_data.startswith(b'\xFF\xF3') or
header_data.startswith(b'\xFF\xFA') or
header_data.startswith(b'\xFF\xFB')) * 2 +
endswith(filename, b".mp3") +
endswith(filename, b".mp2") + endswith(filename, b".mpg") +
endswith(filename, b".mpeg"))
Expand Down
Binary file added tests/data/no-tags.mp3
Binary file not shown.
1 change: 1 addition & 0 deletions tests/test___init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def test_dict(self):
os.path.join(DATA_DIR, "bad-xing.mp3"),
os.path.join(DATA_DIR, "xing.mp3"),
os.path.join(DATA_DIR, "silence-44-s.mp3"),
os.path.join(DATA_DIR, "no-tags.mp3"),
],
Musepack: [
os.path.join(DATA_DIR, "click.mpc"),
Expand Down