From 0e717310d257c213ad91328b8b675bd89a3cc3c6 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Sat, 8 Jun 2024 09:32:21 +0000 Subject: [PATCH] Deal with missing filename extensions for video files. --- sync.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sync.js b/sync.js index c5039f7..a60eed4 100644 --- a/sync.js +++ b/sync.js @@ -127,7 +127,11 @@ async function doWork() { const parts = post.media_url.split('/'); // HACK: despite the .heic extensions, these are JPEG files right now // This will probably change in the future and break things. - const fileName = parts[parts.length - 1].split('?')[0].replace('.heic', '.jpg'); + var fileName = parts[parts.length - 1].split('?')[0].replace('.heic', '.jpg'); + // as of June 2024, no extension seems to mean "video" + if (fileName.indexOf('.') == -1) { + fileName += '.mp4'; + } const downloader = new Downloader({ url: post.media_url,