From 83b1d80a5be263822825b55915705f1108a93f1a Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 16 Jun 2020 19:20:58 -0500 Subject: [PATCH] Fix signature URL regex --- src/invidious/helpers/jobs.cr | 1 + src/invidious/helpers/signatures.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/helpers/jobs.cr b/src/invidious/helpers/jobs.cr index e3d7b520..befed471 100644 --- a/src/invidious/helpers/jobs.cr +++ b/src/invidious/helpers/jobs.cr @@ -190,6 +190,7 @@ def update_decrypt_function decrypt_function = fetch_decrypt_function yield decrypt_function rescue ex + # TODO: Log error next ensure sleep 1.minute diff --git a/src/invidious/helpers/signatures.cr b/src/invidious/helpers/signatures.cr index 5eabb91b..f811500f 100644 --- a/src/invidious/helpers/signatures.cr +++ b/src/invidious/helpers/signatures.cr @@ -2,7 +2,7 @@ alias SigProc = Proc(Array(String), Int32, Array(String)) def fetch_decrypt_function(id = "CvFH_6DNRCY") document = YT_POOL.client &.get("/watch?v=#{id}&gl=US&hl=en").body - url = document.match(/src="(?\/yts\/jsbin\/player_ias-[^\/]+\/en_US\/base.js)"/).not_nil!["url"] + url = document.match(/src="(?\/s\/player\/[^\/]+\/player_ias[^\/]+\/en_US\/base.js)"/).not_nil!["url"] player = YT_POOL.client &.get(url).body function_name = player.match(/^(?[^=]+)=function\(\w\){\w=\w\.split\(""\);[^\. ]+\.[^( ]+/m).not_nil!["name"]