From f85472c0ce345b6adfc97c762317e3e9203eb6c9 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 18 Feb 2019 11:43:57 -0600 Subject: [PATCH] Fix extracting for mixes provided by YouTube Music --- src/invidious/mixes.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/invidious/mixes.cr b/src/invidious/mixes.cr index a3ada8697..c91e83a28 100644 --- a/src/invidious/mixes.cr +++ b/src/invidious/mixes.cr @@ -43,8 +43,10 @@ def fetch_mix(rdid, video_id, cookies = nil, locale = nil) mix_title = playlist["title"].as_s contents = playlist["contents"].as_a - until contents[0]["playlistPanelVideoRenderer"]["videoId"].as_s == video_id - contents.shift + if contents.map { |video| video["playlistPanelVideoRenderer"]["videoId"] }.includes? video_id + until contents[0]["playlistPanelVideoRenderer"]["videoId"].as_s == video_id + contents.shift + end end videos = [] of MixVideo