Skip to content

Fix audio/webm files #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2021
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
20 changes: 19 additions & 1 deletion data/custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,25 @@
<magic priority="50">
<match value="0x1a45dfa3" type="string" offset="0">
<match value="\x42\x82" type="string" offset="4:4096">
<match value="webm" type="string" offset="4:4096" />
<match value="webm" type="string" offset="4:4096">
<match value="V_VP8" type="string" offset="4:4096" />
<match value="V_VP9" type="string" offset="4:4096" />
</match>
</match>
</match>
</magic>
</mime-type>

<mime-type type="audio/webm">
<sub-class-of type="application/x-matroska" />

<magic priority="50">
<match value="0x1a45dfa3" type="string" offset="0">
<match value="\x42\x82" type="string" offset="4:4096">
<match value="webm" type="string" offset="4:4096">
<match value="A_VORBIS" type="string" offset="4:4096" />
<match value="A_OPUS" type="string" offset="4:4096" />
</match>
</match>
</match>
</magic>
Expand Down
3 changes: 2 additions & 1 deletion lib/marcel/tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ module Marcel
['audio/mp4', [[4, 'ftypM4A '], [4, 'ftypM4B '], [4, 'ftypF4A '], [4, 'ftypF4B ']]],
['video/quicktime', [[4, "moov\000"], [4, "mdat\000"], [4, "free\000"], [4, "skip\000"], [4, "pnot\000"], [4, 'ftyp'], [0, "\000\000\000\bwide"]]],
['video/mpeg', [[0, "\000\000\001\263"], [0, "\000\000\001\272"]]],
['video/webm', [[0, "\032E\337\243", [[4..4096, "B\202", [[4..4096, 'webm']]]]]]],
['video/webm', [[0, "\032E\337\243", [[4..4096, "B\202", [[4..4096, 'webm', [[4..4096, 'V_VP8'], [4..4096, 'V_VP9']]]]]]]]],
['video/x-matroska', [[0, "\032E\337\243\223B\202\210matroska"]]],
['video/x-flv', [[0, 'FLV']]],
['audio/mpeg', [[0, "\377\362"], [0, "\377\363"], [0, "\377\364"], [0, "\377\365"], [0, "\377\366"], [0, "\377\367"], [0, "\377\372"], [0, "\377\373"], [0, "\377\374"], [0, "\377\375"], [0, "\377\377"], [0, 'ID3']]],
Expand Down Expand Up @@ -2402,6 +2402,7 @@ module Marcel
['audio/amr-wb', [[0, "#!AMR-WB\n"]]],
['audio/eac3', [[0, "\vw"]]],
['audio/prs.sid', [[0, 'PSID']]],
['audio/webm', [[0, "\032E\337\243", [[4..4096, "B\202", [[4..4096, 'webm', [[4..4096, 'A_VORBIS'], [4..4096, 'A_OPUS']]]]]]]]],
['audio/x-flac', [[0, 'fLaC']]],
['audio/x-mod', [[0, 'Extended Module:'], [21, 'BMOD2STM'], [1080, 'M.K.'], [1080, 'M!K!'], [1080, 'FLT4'], [1080, 'FLT8'], [1080, '4CHN'], [1080, '6CHN'], [1080, '8CHN'], [1080, 'CD81'], [1080, 'OKTA'], [1080, '16CN'], [1080, '32CN'], [0, 'IMPM']]],
['audio/x-mpegurl', [[0, "#EXTM3U\r\n"]]],
Expand Down
Binary file added test/fixtures/magic/audio/webm/webm.webm
Binary file not shown.