In the last weeks, Twitch began sending ads that streamlink couldn't block anymore. One of the solutions proposed by streamlink is to get the auth-token after a sucessuful login through your browser to authenticate. By doing this, if you have Twitch Turbo or you are a sub of some channel, you wont get the ads.
In this post and, later explained in this one, they showed how you can get the auth-token to use the commands --http-header or --twitch-api-header in the streamlink CLI.
But, I'm using the streamlink python package to build a GUI and I don't know how can I use the auth-token to authenticate through there.
Here's what I have tried already:
class MyClass:
def __init__(self):
auth = 'abcdefghijklmnopqrstuvwxyz0123'
self.session = streamlink.Streamlink(options={'--twitch-api-header': f"Authorization=OAuth {auth}"})
But the Streamlink session class can't handle that key.
Can anyone help me? Thank you.