Since Nov 2019 third-party apps can not access private Twitch APIs anymore (issue #2680). Because of that streamlink has removed support for OAuth tokens in PR-2846. However, it is still possible to access private APIs by using first-party OAuth token that can be extracted from cookies.
This fork reintroduces --twitch-oauth-token
parameter into newer versions of streamlink.
This change allows paid subscribers to watch and download private streams and VODs without ads.
- Install this fork with pip (it will replace the original streamlink)
pip install git+https://github.com/TheDrHax/streamlink.git
-
Extract OAuth token from Twitch
- Open Twitch in your favorite browser
- Log in if you haven't already
- Open developer tools (RMB → Inspect element or F12)
- Type this command into JavaScript console:
cookies['auth-token']
- Console will output a single string - your OAuth token
- Warning: Do not share your OAuth token - it grants almost full access to your account! I believe this is the reason why support for OAuth tokens was dropped in the original project.
-
Add
--twitch-oauth-token=YOUR_TOKEN
to your streamlink command -
(optional) Add
twitch-oauth-token=YOUR_TOKEN
to your config file to avoid typing your token every time (see the docs below for more information)
- Q: Does OAuth token expire? If so, how long does it work for?
I have been using the same token for more than a year. I think it will work as long as you don't log out from the website or change your password.
Streamlink is a CLI utility which pipes video streams from various services into a video player, such as VLC.
The main purpose of streamlink is to avoid resource-heavy and unoptimized websites, while still allowing the user to enjoy various streamed content.
Streamlink is a fork of the Livestreamer project.
Please note that by using this application you're bypassing ads run by sites such as Twitch.tv. Please consider donating or paying for subscription services when they are available for the content you consume and enjoy.
Please refer to our documentation for different ways to install Streamlink:
Streamlink is built upon a plugin system which allows support for new services to be easily added. Most of the big streaming services are supported, such as:
... and many more. A full list of plugins currently included can be found on the plugin page.
After installing, simply use:
streamlink STREAMURL best
The default behavior of Streamlink is to play back streams in the VLC player.
For more in-depth usage and install instructions, please refer to the detailed documentation.
All contributions are welcome. Feel free to open a new thread on the issue tracker or submit a new pull request. Please read CONTRIBUTING.md first. Thanks!
Thank you to all our backers! [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]