Invidious is an alternative front-end to YouTube
Update regex expressions to handle unexpected '};'
syeopite608313c1d1e0
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.crindex 5d127e1a..5e49afb7 100644--- a/src/invidious/helpers/helpers.cr+++ b/src/invidious/helpers/helpers.cr@@ -678,7 +678,7 @@ def create_notification_stream(env, topics, connection_channel)enddef extract_initial_data(body) : Hash(String, JSON::Any)- return JSON.parse(body.match(/(window\["ytInitialData"\]|var\s*ytInitialData)\s*=\s*(?<info>\{.*?\});/mx).try &.["info"] || "{}").as_h+ return JSON.parse(body.match(/(window\["ytInitialData"\]|var\s*ytInitialData)\s*=\s*(?<info>{.*?});<\/script>/mx).try &.["info"] || "{}").as_henddef proxy_file(response, env)diff --git a/src/invidious/videos.cr b/src/invidious/videos.crindex e6d4c764..2b793a1b 100644--- a/src/invidious/videos.cr+++ b/src/invidious/videos.cr@@ -818,7 +818,7 @@ enddef extract_polymer_config(body)params = {} of String => JSON::Any- player_response = body.match(/(window\["ytInitialPlayerResponse"\]|var\sytInitialPlayerResponse)\s*=\s*(?<info>{.*?});/m)+ player_response = body.match(/(window\["ytInitialPlayerResponse"\]|var\sytInitialPlayerResponse)\s*=\s*(?<info>{.*?});\s*var\s*meta/m).try { |r| JSON.parse(r["info"]).as_h }if body.includes?("To continue with your YouTube experience, please fill out the form below.") ||