Deal with missing filename extensions for video files.
This commit is contained in:
6
sync.js
6
sync.js
@@ -127,7 +127,11 @@ async function doWork() {
|
|||||||
const parts = post.media_url.split('/');
|
const parts = post.media_url.split('/');
|
||||||
// HACK: despite the .heic extensions, these are JPEG files right now
|
// HACK: despite the .heic extensions, these are JPEG files right now
|
||||||
// This will probably change in the future and break things.
|
// 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({
|
const downloader = new Downloader({
|
||||||
url: post.media_url,
|
url: post.media_url,
|
||||||
|
|||||||
Reference in New Issue
Block a user