mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-28 10:29:22 +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
|
obj.has_media = true
|
||||||
if(!gif_to_mp4) {
|
if(!gif_to_mp4) {
|
||||||
if(post.preview) {
|
if(post.preview) {
|
||||||
|
if(post.preview.reddit_video_preview) {
|
||||||
|
if(post.preview.reddit_video_preview.fallback_url) {
|
||||||
obj.media = {
|
obj.media = {
|
||||||
source: await downloadAndSave(post.preview.reddit_video_preview.fallback_url),
|
source: await downloadAndSave(post.preview.reddit_video_preview.fallback_url),
|
||||||
height: post.preview.reddit_video_preview.height,
|
height: post.preview.reddit_video_preview.height,
|
||||||
@ -99,6 +101,12 @@ module.exports = function() {
|
|||||||
duration: post.preview.reddit_video_preview.duration,
|
duration: post.preview.reddit_video_preview.duration,
|
||||||
is_gif: true
|
is_gif: true
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
obj.has_media = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
obj.has_media = false
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
obj.has_media = false
|
obj.has_media = false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user