From 810aea476f04e80d5527d36fa812c3e22af528b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Mon, 29 Nov 2021 22:33:45 +0100 Subject: [PATCH] Use gtuber lib for URIs with "gtuber" scheme Take a different code path when URI uses "gtuber" scheme. This allows testing new WIP lib as an opt-in. --- src/youtube.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/youtube.js b/src/youtube.js index 7cd7d8e1..f8b700b2 100644 --- a/src/youtube.js +++ b/src/youtube.js @@ -969,6 +969,11 @@ function checkYouTubeUri(uri) const originalHost = gstUri.get_host(); gstUri.normalize(); + /* TODO: Remove all this YT code */ + const scheme = gstUri.get_scheme(); + if (scheme && scheme === 'gtuber') + return [false, null]; + const host = gstUri.get_host(); let videoId = null; @@ -988,7 +993,6 @@ function checkYouTubeUri(uri) videoId = gstUri.get_path_segments()[1]; break; default: - const scheme = gstUri.get_scheme(); if(scheme === 'yt' || scheme === 'youtube') { /* ID is case sensitive */ videoId = originalHost;