mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-09 12:52:32 +01:00
check post.preview
This commit is contained in:
parent
a1bf92471b
commit
a1e53600e6
@ -102,6 +102,7 @@ module.exports = function() {
|
||||
} else {
|
||||
obj.has_media = true
|
||||
if(!gif_to_mp4) {
|
||||
if(post.preview) {
|
||||
obj.media = {
|
||||
source: await downloadAndSave(post.preview.reddit_video_preview.fallback_url),
|
||||
height: post.preview.reddit_video_preview.height,
|
||||
@ -109,6 +110,9 @@ module.exports = function() {
|
||||
duration: post.preview.reddit_video_preview.duration,
|
||||
is_gif: true
|
||||
}
|
||||
} else {
|
||||
obj.has_media = false
|
||||
}
|
||||
} else {
|
||||
obj.media = {
|
||||
source: await downloadAndSave(gif_to_mp4.url, null, true),
|
||||
|
Loading…
Reference in New Issue
Block a user