Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Youtube shorts black screen after latest update. #502

Closed
Ameer-Jamal opened this issue Jun 5, 2024 · 2 comments
Closed

Youtube shorts black screen after latest update. #502

Ameer-Jamal opened this issue Jun 5, 2024 · 2 comments

Comments

@Ameer-Jamal
Copy link

Ameer-Jamal commented Jun 5, 2024

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
image

Desktop (please complete the following information):

  • OS: [MacOS]
  • Browser edge
@Ameer-Jamal
Copy link
Author

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

@Ameer-Jamal
Copy link
Author

PR #505 505 Up to help solve this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants