Replace lookbehind regexp

This was only supported in latest GJS version
This commit is contained in:
Rafał Dzięgiel
2021-03-18 09:28:00 +01:00
parent fcff4b4450
commit 38e5bae199

View File

@@ -166,7 +166,11 @@ var YouTubeClient = GObject.registerClass({
break; 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) { if(!ytPath) {
debug(new Error('could not find YouTube player URI')); debug(new Error('could not find YouTube player URI'));
break; break;