From 38e5bae19961f40d7a1144b4462a06837cb2677c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Thu, 18 Mar 2021 09:28:00 +0100 Subject: [PATCH] Replace lookbehind regexp This was only supported in latest GJS version --- src/youtube.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/youtube.js b/src/youtube.js index b22b159d..4af811f5 100644 --- a/src/youtube.js +++ b/src/youtube.js @@ -166,7 +166,11 @@ var YouTubeClient = GObject.registerClass({ break; } - const ytPath = result.data.match(/(?<=jsUrl\":\").*?(?=\")/gs)[0]; + let ytPath = result.data.match(/jsUrl\":\"(.*?)\.js/g); + if(ytPath) { + ytPath = (ytPath[0] && ytPath[0].length > 16) + ? ytPath[0].substring(8) : null; + } if(!ytPath) { debug(new Error('could not find YouTube player URI')); break;