Deal with missing filename extensions for video files.

This commit is contained in:
2024-06-08 09:32:21 +00:00
parent caad0d91e4
commit 0e717310d2

View File

@@ -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,