From 270e59137d9225d406a4b188fe095fdbf28d11d9 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sun, 14 Mar 2021 16:39:22 +0100 Subject: [PATCH] YT: check if player URI is valid --- src/youtube.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/youtube.js b/src/youtube.js index be6a8323..6abf8ab7 100644 --- a/src/youtube.js +++ b/src/youtube.js @@ -100,6 +100,14 @@ var YouTubeClient = GObject.registerClass({ break; } const ytUri = `https://www.youtube.com${ytPath}`; + if( + /* check if site has "/" after ".com" */ + ytUri[23] !== '/' + || !Gst.Uri.is_valid(ytUri) + ) { + debug(`misformed player URI: ${ytUri}`); + break; + } debug(`found player URI: ${ytUri}`); /* TODO: cache */