Hakkin / twitchpipe

Pipe your favorite Twitch streams to the media player of your choice, or a file to save them for later. Supports low-latency playback.
MIT License
35 stars 5 forks source link

An updated experience #19

Open 0042 opened 1 year ago

0042 commented 1 year ago

Hi, as of 2022-11-10(?), twitchpipe recordings contain intermission screens. One "preparing your stream..." screen at the beginning (15s), and "commercial break in progress" screens during ads.

For some recordings, the "commercial break in progress" screen does not appear, the vod will simply jump to next segment. The result is the start of a broadcast is missing, and seeking during playback is pretty broken.

I assume this is due to embed streams getting an 'updated experience' https://discuss.dev.twitch.tv/t/an-updated-twitch-embedded-player-viewer-experience/41718 https://github.com/streamlink/streamlink/issues/4934#issuecomment-1309869042

It's understandable if there's little interest in continuing given Twitch's goal of self-destruction. Regardless, gratitude is long overdue for a project that has worked flawlessly for this length of time. Thank you

Hakkin commented 1 year ago

Hi, thanks for the issue. I'm also seeing the same thing, seems like Twitch finally patched the embedded player loophole. Unfortunately, unless somebody finds some new combination of headers that makes Twitch not return ads, it seems like it's no longer possible to bypass them easily. I can't promise anything, but there are a few things I would like to try. At the very least it's definitely possible to just filter out the ad segments, I wasn't doing this up until now because, at least on my end, they were never presented to me in the first place, so there was no need to filter them. I think it also should be possible to, instead of just filtering the segments, replace them with their 360p30 counterparts from the ad-free sub-stream Twitch provides. This should make it possible again to capture the very start of the broadcast and bits between commercial breaks, albeit at a lower quality than source. I can't give any precise timeline on when I could make these updates though, sorry.

Hakkin commented 1 year ago

Oh, another thing I thought of was allowing the proxying of the m3u8, apparently Twitch won't serve ads to certain countries if you proxy the playlist? Needs more experimenting though, you can already do this by setting the HTTPS_PROXY env var, but it will proxy the segments too which might not be what you want.

0042 commented 1 year ago

Hi, thanks for the prompt reply. I'm glad to hear that you're still interested in the project. Currently I've reverted to streamlink which is an absolute mess of spaghetti python, it's using 5x cpu load per-stream (compared to twitchpipe) but it's working, for now.

Hakkin commented 1 year ago

Hi, Twitch finally killed what remained of their old API, forcing me to update to the GQL API. In the process, I added a few basic flags that can help a bit with bypassing ads. See https://github.com/Hakkin/twitchpipe/releases/tag/v0.3.0 At the very least, if you really want to bypass the ads, you can buy Twitch Turbo and then put your account's OAuth token into --access-token-oauth. Otherwise, it's pretty much the same cat and mouse game of people finding combinations of player/platform/device-ID workarounds until Twitch patches them. For now I've just defaulted them back to "web"/"site" like the default Twitch web player uses since I don't know of anything better.

I still haven't been able to get around to adding the more advanced features like I discussed above, I've sketched out a basic design, but I think it would pretty much require a complete rewrite of the program, and would be much more complex than it currently is. I still want to do it, but I'll have to find the time.