summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-03-27 22:10:28 -0400
committerChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-03-27 22:10:28 -0400
commitf840addd930945141a6d4fdf7e7eb8376411d82d (patch)
treea3adc1412a6030f25310f8d88ccbdf118f13a6f6 /src
parent8a44bd11d2abab8c9203d6dc3c3d5824e5e26327 (diff)
downloadinvidious-f840addd930945141a6d4fdf7e7eb8376411d82d.tar.gz
invidious-f840addd930945141a6d4fdf7e7eb8376411d82d.tar.bz2
invidious-f840addd930945141a6d4fdf7e7eb8376411d82d.zip
Fix error when song title is missing from the track
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos/parser.cr5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr
index 608ae99d..13ee5f65 100644
--- a/src/invidious/videos/parser.cr
+++ b/src/invidious/videos/parser.cr
@@ -330,7 +330,10 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
# Used when the video has multiple songs
if song_title = music_desc.dig?("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title")
# "simpleText" for plain text / "runs" when song has a link
- song = song_title["simpleText"]? || song_title.dig("runs", 0, "text")
+ song = song_title["simpleText"]? || song_title.dig?("runs", 0, "text")
+
+ # some videos can have empty tracks. See: https://www.youtube.com/watch?v=eBGIQ7ZuuiU
+ next if !song
end
music_desc.dig?("carouselLockupRenderer", "infoRows").try &.as_a.each do |desc|