ajayyy / SponsorBlock

Skip YouTube video sponsors (browser extension)
https://sponsor.ajay.app
GNU General Public License v3.0
10.41k stars 329 forks source link

Fix YouTube TV Support #213

Open Leseratte10 opened 4 years ago

Leseratte10 commented 4 years ago

Youtube provides a TV-friendly web page at https://youtube.com/tv that looks like one of these youtube apps on a smart TV, which also allows you to "send" a youtube video from your phone to that page to watch it on a bigger screen.

SponsorBlock currently doesn't work on that TV-optimized page, maybe support for that could be added? Mouse navigation seems to work a bit weird on that page at least in my browser (because it's optimized for TVs) so I don't know how easy it'd be to add the sponsor spot report buttons, but the playback feature (skipping spots that are already reported) should work similar to the normal YouTube page.

NDevTK commented 4 years ago

Going to youtube.com/tv seems to get redirected. The user agent "AppleTV/tvOS/9.1.1" seems to fix this :D (For debugging) example video: https://www.youtube.com/tv#/watch/video/idle?v=dQw4w9WgXcQ&resume

Leseratte10 commented 4 years ago

Oh, right, sorry, forgot to add that. Youtube seems to block normal clients from that page. This chrome addon ( https://chrome.google.com/webstore/detail/youtube-for-tv/gmmbpchnelmlmndfnckechknbohhjpge ) fixes the user agent just for this youtube page so you don't manually need to change it.

ajayyy commented 4 years ago

Ah, I was very confused

ajayyy commented 4 years ago

Is this related to https://github.com/yuliskov/SmartYouTubeTV?

Leseratte10 commented 4 years ago

I don't know? Isn't that just basically a browser apk that automatically goes to youtube.com/tv? I just manually visit that youtube page on my computer (with that chrome addon to spoof my user agent).

NDevTK commented 4 years ago

https://github.com/ajayyy/SponsorBlock/pull/214 (URL Parser support)

ajayyy commented 4 years ago

Support has been added. This issue will be left open for the preview bar support.

NDevTK commented 4 years ago

Will there be buttons on the player?

ajayyy commented 4 years ago

I don't think that is really necessary since this would be run off of a TV.

ajayyy commented 4 years ago

Seems to be broken

itskenny0 commented 4 years ago

@ajayyy Works just fine for me as of this moment, but the UI overlays the skip interface so its only halfway usable.

nimaid commented 4 years ago

@ajayyy This is currently not working for me.

OS: Windows 10 Browser: Firefox 80.0.1 (64-bit) YouTube TV enabler: https://addons.mozilla.org/en-US/firefox/addon/youtube-for-tv/ Example non-working URL: https://www.youtube.com/tv/#/watch/video/control?v=bUGlwTi0D_Y&resume Issue description: SopnsorBlock states that No YouTube video is found at this tab.

I have not tried Chrome yet.

DraconicNEO commented 2 years ago

For me it's able to detect the video but it's not able to skip anything or show segments.

pl4nty commented 2 years ago

I'm having a similar experience, segments are detected but not shown/skipped. User agent is Mozilla/5.0 (Linux; Tizen 2.3) AppleWebKit/538.1 (KHTML, like Gecko)Version/2.3 TV Safari/538.1

spj2401Dev commented 1 year ago

It is still now working for me either. I can set submit timestamps over the addon on the top, but no timestamps or skips. Its just telling me that there were no segments found but it now recognises that I am on a YouTube page. I am using Chrome btw.

mchangrh commented 1 year ago

Standalone

will test remote control later

mchangrh commented 1 year ago

.take

mchangrh commented 1 year ago

Trying to add events for leanback was inconclusive, so will leave this as a definitive catchall for tv playback issues

Events: yt-navigate-finish ❌ yt-player-updated ❌ innertube-command ❌

it also loves reloading the UI with every single document.focus and document.blur change which makes binding to the previewbar every very difficult

Extensions: firefox chrome

Test UAs

Mozilla/5.0 (Linux; Tizen 2.3) AppleWebKit/538.1 (KHTML, like Gecko)Version/2.3 TV Safari/538.1

AppleTV/tvOS/9.1.1

The only URL that fails the v parameter check was reported in discord which featured a query parameter after an anchor and was revolved with this commit. Binding to the previewbar will require either a hook into their JS and/or a mutation observer