TIL: Streamlink
Stream your favorite shows from your video player
One small but very useful library I often use is Streamlink. It is a remarkable piece of software that streams real-time content (Twitch, YouTube, etc.) from a video player. This can be useful if your browser is struggling to display the image properly or the resolution isn’t great.
Installation
There are various ways to install it depending on your taste.
Windows
# choco
$ choco install streamlink
# scoop
$ scoop bucket add extras
$ scoop install streamlink
# winget
$ winget install streamlinkMacOS
$ brew install streamlinkMain Linux distributions
# Debian-like
$ sudo apt update
$ sudo apt install streamlink
# Arch Linux
$ sudo pacman -S streamlink
# Fedora
$ sudo dnf install streamlinkPython way
You can use projects like uv or pipx to install it.
$ pipx install streamlink
# or with uv
$ uv tool install streamlinkYou can find more installation options for Streamlink here.
Usage
You will need to install a compatible video player. The two most supported are VLC and mpv, which are cross-platform. For a detailed list of supported players, look at this page.
After that, you enter streamlink followed by the live-streaming URL and the word best.
# example with twitch
$ streamlink https://www.twitch.tv/channel bestThe keyword best chooses the best resolution for you. To know all the resolutions available, just remove the word best.
$ streamlink https://www.twitch.tv/channel
cli][info] Found matching plugin twitch for URL https://www.twitch.tv/channel
Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)To choose a specific resolution, for example, the 720p60, you have to do this:
$ streamlink https://www.twitch.tv/channel 720p60To know all the websites supported, you can look at the plugins page. Some plugins, like TF1 (a French TV channel) will require additional options to be passed to the command line.
Also, pay attention to your terminal’s shell syntax as mentioned here.
This is all for this article, hope you enjoy reading it. Take care of yourself and see you soon. 😁
