Zren / ResizeYoutubePlayerToWindowSize

Userscript: Moves the YouTube video to the top of the website and fill the window with the video player.
156 stars 13 forks source link

Script pushes list of live broadcasts where it should do nothing #46

Closed mirmalis closed 4 years ago

mirmalis commented 4 years ago

Script pushes list of live broadcasts where it should do nothing, on games 'Live' tab (such as https://www.youtube.com/channel/UC1ERAqx0EIMpr_uA4BD2WUw/live). This would help:

// @exclude         http*://*.youtube.com/channel/*/live
// @exclude         http*://youtube.com/channel/*/live
// @exclude         http*://*.youtu.be/channel/*/live
// @exclude         http*://youtu.be/channel/*/live
Zren commented 4 years ago

It's not that easy. This is a feature added in Issue #29. These urls are valid video pages:

It looks like I need to check if it's still a "watch" [video] page as well after the page loads for these "auto-generated" gaming channels.

Zren commented 4 years ago

Tell me if you have any issues with:

    ytwp.isWatchUrl = function (url) {
        if (!url)
            url = uw.location.href;
        if (url.match(/https?:\/\/(www\.)?youtube.com\/(c|channel|user)\/[^\/]+\/live/)) {
            if (document.querySelector('ytd-browse')) {
                return false
            } else {
                return true
            }
        }
        return url.match(/https?:\/\/(www\.)?youtube.com\/watch\?/);
    };

I've no idea where to click a /channel/asdfsdf_aswdfsadf/live link on YouTube, so I can't test YouTube's "dynamic page loading".

mirmalis commented 4 years ago

This fix seems to work for me. You can find autogenerated gaming channels here: https://www.youtube.com/gaming/games

Zren commented 4 years ago

Ah, your autogenerated /live links are easy to find (just gotta visit the "home" of a channel). I can't find a live links from #29 on YouTube itself anywhere. I think it's a url used for sharing on twitter or something.