新上传格式

This commit is contained in:
2022-04-01 14:26:50 +08:00
parent 55f0e77759
commit 5acd48bf4d
2 changed files with 26 additions and 9 deletions

View File

@@ -27,7 +27,11 @@ function escape_regex(string) {
function is_video(s) {
try {
let url = new URL(s);
return url.pathname.endsWith('.mp4') || url.pathname.endsWith('.mov');
return (
url.pathname.endsWith('.mp4') ||
url.pathname.endsWith('.mov') ||
(url.searchParams.get('filetype') || '').startsWith('video/')
);
} catch (e) {
return false;
}