|
|
@ -325,12 +325,10 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
|
|
|
album = nil
|
|
|
|
album = nil
|
|
|
|
music_license = nil
|
|
|
|
music_license = nil
|
|
|
|
|
|
|
|
|
|
|
|
# used when multiple songs
|
|
|
|
# Used when the video has multiple songs
|
|
|
|
song = music_desc.dig?("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title", "simpleText")
|
|
|
|
if song_title = music_desc.dig?("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title")
|
|
|
|
|
|
|
|
# "simpleText" for plain text / "runs" when song has a link
|
|
|
|
# used when multiple songs and the song has a link
|
|
|
|
song = song_title["simpleText"]? || song_title.dig("runs", 0, "text")
|
|
|
|
if !song
|
|
|
|
|
|
|
|
song = music_desc.dig("carouselLockupRenderer", "videoLockup", "compactVideoRenderer", "title", "runs", 0, "text")
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
music_desc.dig?("carouselLockupRenderer", "infoRows").try &.as_a.each do |desc|
|
|
|
|
music_desc.dig?("carouselLockupRenderer", "infoRows").try &.as_a.each do |desc|
|
|
|
|