Update regex expressions to handle unexpected '};'

This commit is contained in:
syeopite
2021-03-29 17:37:12 -07:00
parent 2c1cf42994
commit 608313c1d1
2 changed files with 2 additions and 2 deletions

View File

@@ -818,7 +818,7 @@ end
def 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.") ||