uploads: allow uploading iso5 .mp4 files.

This is an MP4 ftyp sometimes used by Twitter.
This commit is contained in:
evazion
2022-02-09 16:45:49 -06:00
parent 26d54c1e37
commit 58fc00e549
4 changed files with 8 additions and 2 deletions

BIN
test/files/test-iso5.mp4 Normal file

Binary file not shown.

View File

@@ -313,7 +313,8 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
should_upload_successfully("https://pbs.twimg.com/media/DCdZ_FhUIAAYKFN?format=jpg&name=medium")
should_upload_successfully("https://pbs.twimg.com/profile_banners/2371694594/1581832507/1500x500")
should_upload_successfully("https://twitter.com/zeth_total/status/1355597580814585856")
# XXX should_upload_successfully("https://video.twimg.com/tweet_video/EWHWVrmVcAAp4Vw.mp4")
should_upload_successfully("https://video.twimg.com/tweet_video/FLKI6DWakAQFRkC.mp4")
should_upload_successfully("https://video.twimg.com/tweet_video/EWHWVrmVcAAp4Vw.mp4")
should_upload_successfully("https://www.weibo.com/5501756072/J2UNKfbqV")
should_upload_successfully("https://wx1.sinaimg.cn/mw690/0060kO5aly1gezsyt5xvhj30ok0sgtc9.jpg")

View File

@@ -97,6 +97,10 @@ class MediaFileTest < ActiveSupport::TestCase
assert_equal(:mp4, MediaFile.open("test/files/test-audio.m4v").file_ext)
end
should "determine the correct extension for an iso5 mp4 file" do
assert_equal(:mp4, MediaFile.open("test/files/test-iso5.mp4").file_ext)
end
should "determine the correct extension for a ugoira file" do
assert_equal(:zip, MediaFile.open("test/files/ugoira.zip").file_ext)
end