fixes for the #134 PR

This commit is contained in:
teddit 2021-01-24 15:05:59 +01:00
parent 666a4bdd01
commit 185cf22847
1 changed files with 4 additions and 1 deletions

View File

@ -51,9 +51,12 @@ module.exports = function() {
}
} else {
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 = {
thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_'),
preview: await downloadAndSave(data.preview.images[0].source.url, 'preview_')
preview: preview
}
}
}