summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThéo Gaillard <theo.gaillard@protonmail.com>2020-11-26 17:52:16 +0100
committerThéo Gaillard <theo.gaillard@protonmail.com>2020-11-26 18:22:31 +0100
commitb41ca72d2b85c8d6ee5186873bf4be4c331e3798 (patch)
tree733fcd8978a2bbce3a5e1d14690bc2a184ba4896
parent1ba17a0e148b7cb52b34d756c945f5d8976b9913 (diff)
downloadinvidious-b41ca72d2b85c8d6ee5186873bf4be4c331e3798.tar.gz
invidious-b41ca72d2b85c8d6ee5186873bf4be4c331e3798.tar.bz2
invidious-b41ca72d2b85c8d6ee5186873bf4be4c331e3798.zip
revert: remove 'JSON.parse("'
-rw-r--r--src/invidious/helpers/helpers.cr2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr
index 5e4cd4ef..7a0cb3d3 100644
--- a/src/invidious/helpers/helpers.cr
+++ b/src/invidious/helpers/helpers.cr
@@ -598,7 +598,7 @@ def create_notification_stream(env, topics, connection_channel)
end
def extract_initial_data(body) : Hash(String, JSON::Any)
- return JSON.parse(body.match(/(window\["ytInitialData"\]|var\s*ytInitialData)\s*=\s*(?<info>\{.*?\});/m).try &.["info"] || "{}").as_h
+ return JSON.parse(body.match(/(window\["ytInitialData"\]|var\s*ytInitialData)\s*=\s*(JSON\.parse\(")?(?<info>\{.*?\})("\))?;/m).try &.["info"] || "{}").as_h
end
def proxy_file(response, env)