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