fixes for the #134 PR

This commit is contained in:
teddit 2021-01-24 15:05:59 +01:00
parent 666a4bdd01
commit 185cf22847

View File

@ -51,9 +51,12 @@ module.exports = function() {
} }
} else { } else {
if(data.preview.images[0].resolutions[0]) { if(data.preview.images[0].resolutions[0]) {
let preview = null
if(!isGif(data.url) && data.post_hint !== 'rich:video')
preview = await downloadAndSave(data.preview.images[0].source.url)
images = { images = {
thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_'), thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_'),
preview: await downloadAndSave(data.preview.images[0].source.url, 'preview_') preview: preview
} }
} }
} }