Closed Ameer-Jamal closed 3 months ago
//
// Get the url
//
let videoID = '';
const baseVideoURL = 'https://www.youtube.com/watch?v=';
const baseShortsURL = 'https://www.youtube.com/shorts/';
let startIndex = currentUrl.indexOf(baseVideoURL);
if (startIndex !== -1) {
// Extract the part of the URL after the base URL
const videoIDStart = startIndex + baseVideoURL.length;
videoID = currentUrl.substring(videoIDStart);
const ampersandIndex = videoID.indexOf('&');
if (ampersandIndex !== -1) {
videoID = videoID.substring(0, ampersandIndex);
}
} else {
startIndex = currentUrl.indexOf(baseShortsURL);
if (startIndex !== -1) {
// Extract the part of the URL after the base URL
const videoIDStart = startIndex + baseShortsURL.length;
videoID = currentUrl.substring(videoIDStart);
const slashIndex = videoID.indexOf('/');
if (slashIndex !== -1) {
videoID = videoID.substring(0, slashIndex);
}
} else {
log("YouTube video URL not found.", "e")
return null;
}
}
Im working on it , its because the url isnt properly parsed for shorts, but for some reason im getting double audio
PR #505 505 Up to help solve this
Script version 5.5
Describe the bug Opening a youtube short results in the audio being played but the screen being black, so the video is running but its like just black you cant see it, when I disable the script the video shows. Please fix, thanks devs!
Expected behavior youtube shorts working and video showing as without this script
Screenshots
Desktop (please complete the following information):