mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-24 16:19:23 +01:00
check that reddit_video_preview.fallback_url exists (fixes #255)
This commit is contained in:
parent
a9f13741bb
commit
c34c32cc35
@ -92,6 +92,8 @@ module.exports = function() {
|
||||
obj.has_media = true
|
||||
if(!gif_to_mp4) {
|
||||
if(post.preview) {
|
||||
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,
|
||||
@ -99,6 +101,12 @@ module.exports = function() {
|
||||
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