diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2023-03-31 22:34:33 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2023-03-31 22:34:33 +0200 |
| commit | ef6eea3a652ed29dd44661f8b0d5a0eab3a73861 (patch) | |
| tree | cba5038f8b3c2a871ff96f2e6a94f9fe23103d8c | |
| parent | d52609438058bf80080cc5492201de1c2b09f6b4 (diff) | |
| parent | f840addd930945141a6d4fdf7e7eb8376411d82d (diff) | |
| download | invidious-ef6eea3a652ed29dd44661f8b0d5a0eab3a73861.tar.gz invidious-ef6eea3a652ed29dd44661f8b0d5a0eab3a73861.tar.bz2 invidious-ef6eea3a652ed29dd44661f8b0d5a0eab3a73861.zip | |
Videos: ignore empty music entries (#3709)
| -rw-r--r-- | src/invidious/videos/parser.cr | 5 |
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| |
