summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-03-07 13:06:15 -0500
committerChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-03-07 13:06:15 -0500
commit742c951bc9fdc6eb1e5687104e67500fb778e0ea (patch)
treef14b05faaa31aa8884be6e32df28b4fee63a56d4 /src
parentd8e23d34b63b8f4f34da5c6b4bddf6eb46a3a828 (diff)
downloadinvidious-742c951bc9fdc6eb1e5687104e67500fb778e0ea.tar.gz
invidious-742c951bc9fdc6eb1e5687104e67500fb778e0ea.tar.bz2
invidious-742c951bc9fdc6eb1e5687104e67500fb778e0ea.zip
support videos with multiple songs
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos/parser.cr9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr
index 1a8c25e4..722c90e8 100644
--- a/src/invidious/videos/parser.cr
+++ b/src/invidious/videos/parser.cr
@@ -322,10 +322,17 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
music_desclist.try &.as_a.each do |music_desc|
artist = nil
- song = nil
album = nil
music_license = nil
+ # used when multiple songs
+ song = music_desc.dig?("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title", "simpleText")
+
+ # used when multiple songs and the song has a link
+ if !song
+ song = music_desc.dig("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title", "runs", 0, "text")
+ end
+
music_desc.dig?("carouselLockupRenderer", "infoRows").try &.as_a.each do |desc|
desc_title = extract_text(desc.dig?("infoRowRenderer", "title"))
if desc_title == "ARTIST"