Invidious is an alternative front-end to YouTube
Fix signature URL regex
Omar Roth83b1d80a5be2
diff --git a/src/invidious/helpers/jobs.cr b/src/invidious/helpers/jobs.crindex e3d7b520..befed471 100644--- a/src/invidious/helpers/jobs.cr+++ b/src/invidious/helpers/jobs.cr@@ -190,6 +190,7 @@ def update_decrypt_functiondecrypt_function = fetch_decrypt_functionyield decrypt_functionrescue ex+ # TODO: Log errornextensuresleep 1.minutediff --git a/src/invidious/helpers/signatures.cr b/src/invidious/helpers/signatures.crindex 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="(?<url>\/yts\/jsbin\/player_ias-[^\/]+\/en_US\/base.js)"/).not_nil!["url"]+ url = document.match(/src="(?<url>\/s\/player\/[^\/]+\/player_ias[^\/]+\/en_US\/base.js)"/).not_nil!["url"]player = YT_POOL.client &.get(url).bodyfunction_name = player.match(/^(?<name>[^=]+)=function\(\w\){\w=\w\.split\(""\);[^\. ]+\.[^( ]+/m).not_nil!["name"]