mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-24 07:59:22 +01:00
check that reddit_video_preview.fallback_url exists (fixes #255)
This commit is contained in:
parent
a9f13741bb
commit
c34c32cc35
@ -92,12 +92,20 @@ module.exports = function() {
|
||||
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,
|
||||
width: post.preview.reddit_video_preview.width,
|
||||
duration: post.preview.reddit_video_preview.duration,
|
||||
is_gif: true
|
||||
if(post.preview.reddit_video_preview) {
|
||||
if(post.preview.reddit_video_preview.fallback_url) {
|
||||
obj.media = {
|
||||
source: await downloadAndSave(post.preview.reddit_video_preview.fallback_url),
|
||||
height: post.preview.reddit_video_preview.height,
|
||||
width: post.preview.reddit_video_preview.width,
|
||||
duration: post.preview.reddit_video_preview.duration,
|
||||
is_gif: true
|
||||
}
|
||||
} else {
|
||||
obj.has_media = false
|
||||
}
|
||||
} else {
|
||||
obj.has_media = false
|
||||
}
|
||||
} else {
|
||||
obj.has_media = false
|
||||
|
Loading…
Reference in New Issue
Block a user