SponsorBlock icon indicating copy to clipboard operation
SponsorBlock copied to clipboard

Fix YouTube TV Support

Open Leseratte10 opened this issue 5 years ago • 18 comments

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.

Leseratte10 avatar Dec 29 '19 19:12 Leseratte10

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

NDevTK avatar Dec 29 '19 21:12 NDevTK

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.

Leseratte10 avatar Dec 29 '19 21:12 Leseratte10

Ah, I was very confused

ajayyy avatar Dec 29 '19 21:12 ajayyy

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

ajayyy avatar Dec 29 '19 21:12 ajayyy

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).

Leseratte10 avatar Dec 29 '19 21:12 Leseratte10

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

NDevTK avatar Dec 29 '19 21:12 NDevTK

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

ajayyy avatar Dec 29 '19 21:12 ajayyy

Will there be buttons on the player?

NDevTK avatar Dec 29 '19 22:12 NDevTK

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

ajayyy avatar Dec 29 '19 22:12 ajayyy

Seems to be broken

ajayyy avatar Jul 28 '20 02:07 ajayyy

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

itskenny0 avatar Sep 10 '20 10:09 itskenny0

@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.

nimaid avatar Sep 22 '20 18:09 nimaid

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

DraconicNEO avatar Jul 27 '22 22:07 DraconicNEO

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

pl4nty avatar Aug 27 '22 10:08 pl4nty

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.

spj2401Dev avatar Jan 02 '23 13:01 spj2401Dev

Standalone

  • Skipping ✅
  • Previewbar ❌
    • previewbar is removed and recreated on every ui load

will test remote control later

mchangrh avatar Jan 10 '23 03:01 mchangrh

.take

mchangrh avatar Sep 18 '23 18:09 mchangrh

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

mchangrh avatar Sep 19 '23 18:09 mchangrh