Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix error when communitypost video has no description (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer authored May 15, 2022
1 parent 8f88931 commit bc360a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class YoutubeGrabberHelper {
content: {
videoId: videoRenderer.videoId,
title: videoRenderer.title.runs[0].text,
description: videoRenderer.descriptionSnippet.runs[0].text,
description: '',
publishedText: videoRenderer.publishedTimeText.simpleText,
lengthText: videoRenderer.lengthText.simpleText,
viewCountText: videoRenderer.viewCountText.simpleText,
Expand All @@ -348,6 +348,9 @@ class YoutubeGrabberHelper {
thumbnails: videoRenderer.thumbnail.thumbnails
}
}
if ('descriptionSnippet' in videoRenderer) {
postData.postContent.content.description = videoRenderer.descriptionSnippet.runs[0].text
}
if ('ownerBadges' in videoRenderer) {
videoRenderer.ownerBadges.forEach((badge) => {
postData.postContent.content.badges.officialArtist = (badge.metadataBadgeRenderer.tooltip === 'Official Artist Channel' || postData.postContent.content.badges.officialArtist)
Expand Down

0 comments on commit bc360a3

Please sign in to comment.