diff --git a/mutagen/mp3/__init__.py b/mutagen/mp3/__init__.py index 1c9b7e5c..fa7b41d3 100644 --- a/mutagen/mp3/__init__.py +++ b/mutagen/mp3/__init__.py @@ -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")) diff --git a/tests/data/no-tags.mp3 b/tests/data/no-tags.mp3 new file mode 100644 index 00000000..bece8359 Binary files /dev/null and b/tests/data/no-tags.mp3 differ diff --git a/tests/test___init__.py b/tests/test___init__.py index cc813517..6da8d020 100644 --- a/tests/test___init__.py +++ b/tests/test___init__.py @@ -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"),