Skip to content

TWITCH LIVE STREAM ADs #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Zibbp opened this issue Nov 17, 2022 · 4 comments
Open

TWITCH LIVE STREAM ADs #57

Zibbp opened this issue Nov 17, 2022 · 4 comments
Assignees

Comments

@Zibbp
Copy link
Owner

Zibbp commented Nov 17, 2022

Issue

As of a few days ago Twitch has re-enabled embedding ads into the HLS stream. Previously Twitch experimented with this but turned it off. This change has caused issues with archiving live streams (VODs are unaffected to my knowledge).

To archive live streams, Ganymede uses streamlink which has an option to disable ads --twitch-disable-ads. As of a few days ago the enabling of embedding ads again has made some changes to this option. Now with this option, streamlink will cut out detected ad segments, resulting in a shorter video than what the broadcaster streamed. This causes issues with the video and chat sync. Once an ad gets cut out the chat and video are out of sync. Any live stream archived the past couple days will have this issue. VODs are unaffected.

Temporary Solution

As a temporary solution I am pushing out a hotfix that will disable the --twitch-disable-ads option for live archives. With this option disabled, during an ad segment a "showing ads" image will be displayed.

vlc_1hy58ehtrJ

This is not a permanent and ideal solution but the video being cut and shorter than the chat duration is the biggest issue.

Long Term Solution


At this time I advise to download the streamer's VOD instead of performing live archives of their stream. I know this is not always possible due to streamers disabling VODs or having dual audio tracks.

Most Twitch adblocker extensions are not working due to this change. The only ones that I know work are proxy extensions which proxy the HLS playlist request to a country that does not have Twitch ad campaigns.

I will keep this issue updated with the latest information I find.

Have any questions, comments, or solutions? Post them below.

@Zibbp Zibbp self-assigned this Nov 17, 2022
@Zibbp Zibbp added the twitch label Nov 17, 2022
@Zibbp Zibbp pinned this issue Nov 17, 2022
@Zibbp
Copy link
Owner Author

Zibbp commented Nov 17, 2022

Current temporary idea:
Introduce a "streamlink live args" config entry that can be updated via the frontend. This will allow users to add/remove Streamlink arguments. Alongside this add a "twitch user accesstoken" entry in the config for users that have Twitch Turbo or are subbed to streams. For now the user will have to manually add their access token via the frontend.

I'll do some testing tonight, see what works, what doesn't. And hopefully push a release later tonight or tomorrow.

@Zibbp
Copy link
Owner Author

Zibbp commented Nov 18, 2022

Release v1.0.9 was just pushed out. This release add user customizable Streamlink arguments for live stream archives. By default the --twitch-disable-ads argument was removed as it now cuts out ad segments resulting in a short video.

If you have Twitch Turbo or are subscribed to a Twitch channel, you may add an argument that allows you to pass your access token to receive an ad-free HLS playlist to archive. Retrieving your access token can be done by following Streamlink's documentation https://streamlink.github.io/cli/plugins/twitch.html#authentication. Once the token is obtained, add it in an argument like so: --twitch-api-header=Authorization=OAuth abcdefghijklmnopqrstuvwxyz0123 then place the argument at the end of user configurable Streamlink arguments found at Admin > Settings.
brave_8GTeogljdi

The arguments must be comma separated. If you do not have Twitch Turbo or are not subscribed to any channel then it is of no benefit to include your token. For more information regarding the Streamlink arguments setting, visit the wiki.

This is currently the best solution with Twitch's update to embedding the ads directly into the HLS playlist.

I'll try to keep this issue updated with new findings.

@Zibbp
Copy link
Owner Author

Zibbp commented Nov 18, 2022

With the --twitch-api-header argument, you can verify whether the stream will have ads by temporarly adding another argument, --loglevel=debug, and looking at the logs for the video download.

Look for a similar line to what is shown below. This is for a channel that I am subscribed to.

[plugins.twitch][debug] {'adblock': False, 'geoblock_reason': '', 'hide_ads': True, 'server_ads': True, 'show_ads': False}

For a channel that I am not subscribed to.

[plugins.twitch][debug] {'adblock': False, 'geoblock_reason': '', 'hide_ads': False, 'server_ads': True, 'show_ads': True}

@drag0n141
Copy link

I think you can build in the streamlink-ttvlol plugin. With that the users can disable all ads. Is that an option?

@Zibbp Zibbp unpinned this issue Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants