YT: check if player URI is valid

This commit is contained in:
Rafostar
2021-03-14 16:39:22 +01:00
parent ec18ca989a
commit 270e59137d

View File

@@ -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 */