Registry / http-networking / streamlink

streamlink

JSON →
library8.4.0pypypi✓ verified 85d ago

Streamlink is a command-line utility and Python library that extracts streams from various online services (like Twitch, YouTube, etc.) and pipes them into a video player of choice, such as VLC or mpv. It aims to provide a lightweight alternative to resource-heavy and unoptimized websites. The library is actively maintained, with frequent minor and patch releases, and the current stable version is 8.3.0.

pip install streamlink
INSTALL
IMPORT
SIG · STREAMLINK
S
streamlink
http-networkingpythonv8.4.0
Install
4.7s avg
Import
924ms
Disk
75MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v8.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.946s · 75.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.7s · import 0.901s · 77MB
75MB installed
● package 75MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Streamlink
from streamlink import Streamlink
PluginError
from streamlink.exceptions import PluginError
from streamlink.plugins import PluginError
Re-exports of error classes from `streamlink.plugins` were deprecated in 6.8.0 and removed in 7.0.0. Import from `streamlink.exceptions` instead.
NoPluginError
from streamlink.exceptions import NoPluginError
from streamlink.plugins import NoPluginError
Re-exports of error classes from `streamlink.plugins` were deprecated in 6.8.0 and removed in 7.0.0. Import from `streamlink.exceptions` instead.
Plugin
from streamlink.plugin import Plugin
from streamlink.plugins import Plugin
Re-exports of the `Plugin` class from `streamlink.plugins` were deprecated in 6.8.0 and removed in 7.0.0. Import from `streamlink.plugin` instead.
HTTPSession
session = Streamlink() http_session = session.http
from streamlink.plugin.api.http_session import HTTPSession
Direct import of `HTTPSession` from `streamlink.plugin.api` or `streamlink.plugin.api.http_session` was deprecated in 6.6.0 and removed in 7.0.0. Access it via the `Streamlink` session's `http` attribute.

This quickstart demonstrates how to use Streamlink programmatically to find and access streams from a given URL. It initializes a Streamlink session, sets an option, resolves streams for a Twitch URL, and attempts to open the 'best' quality stream. For actual media playback, the stream's file-like object would typically be piped to an external video player process.

import streamlink import os # Initialize a Streamlink session session = streamlink.Streamlink() # Example: Set a session option, e.g., for logging level session.set_option("log-level", "info") # Define the URL and desired stream quality stream_url = "https://www.twitch.tv/twitchdev" desired_quality = "best" try: # Attempt to find streams for the URL streams = session.streams(stream_url) if not streams: print(f"No streams found for {stream_url}") else: # Get the desired stream stream = streams.get(desired_quality) if stream: print(f"Opening {desired_quality} stream from {stream_url}") # Open the stream and read a chunk (or pipe to a player) with stream.open() as fd: # This example just reads a small chunk. For actual playback, # you'd typically pipe this to an external player. # For example, to play with VLC (requires VLC to be installed and in PATH): # import subprocess # player_cmd = ["vlc", "-"] # p = subprocess.Popen(player_cmd, stdin=subprocess.PIPE) # for chunk in iter(lambda: fd.read(8192), b''): # p.stdin.write(chunk) # p.stdin.close() # p.wait() print(f"Successfully accessed {desired_quality} stream.") # For a real application, you'd stream the data to a player or file else: print(f"Stream quality '{desired_quality}' not available. Available: {', '.join(streams.keys())}") except streamlink.exceptions.NoPluginError: print(f"No plugin found for URL: {stream_url}") except streamlink.exceptions.PluginError as e: print(f"Plugin error: {e}")
streamlink --version
Debug
Known issues
breakingStreamlink 8.0.0 dropped support for Python 3.9. Projects must use Python 3.10 or newer.
fix
Upgrade your Python environment to 3.10 or a later supported version.
affects: >=8.0.0
breakingThe `url_master` argument and attribute in `HLSStream` and `MuxedHLSStream` were removed in Streamlink 8.0.0.
fix
Use the `multivariant` parameter/attribute instead, which is an M3U8 reference of the parsed HLS multivariant playlist.
affects: >=8.0.0
breakingStreamlink 8.0.0 updated its `urllib3` dependency, requiring `>=2.0.0`.
fix
Ensure `urllib3` is updated to version 2.0.0 or higher. Running `pip install --upgrade streamlink` should handle this.
affects: >=8.0.0
deprecatedImports of re-exported attributes from `streamlink.stream` and `streamlink.utils` are deprecated.
fix
Refer to the official documentation or migration guides for the correct, direct import paths for these attributes to avoid future breaking changes.
affects: 8.2.0, 8.2.1
gotchaThe `--player` CLI argument changed in Streamlink 6.0.0 to be path-only. It no longer accepts additional player arguments.
fix
Specify custom player arguments using the dedicated `--player-args` CLI argument. Paths with spaces in `--player` no longer require quotation marks.
affects: >=6.0.0
gotchaOld and deprecated config file paths (including plugin-specific ones) are no longer supported since Streamlink 7.0.0.
fix
Move existing configuration files to the new standard paths documented in the CLI guide, or use the `--config` argument to specify a custom path.
affects: >=7.0.0
Errors
Common errors & fixes
No playable streams found on this URL: <URL>
The Streamlink plugin for the given URL could not find any streams, often due to changes on the streaming service's side, an invalid URL, or the stream being offline.
fix
First, verify the URL is correct and the stream is live. Try updating Streamlink (`pip install --upgrade streamlink`) to get the latest plugin definitions. You can also run with `--json` to see raw output or `--loglevel debug` for more details.
Error: Couldn't launch the Stream Unexpected Version check output. / urllib3 (X.Y) or chardet (X.Y.Z) doesn't match a supported version!
A common cause is an incompatibility between Streamlink's `urllib3` dependency (or `requests`' dependency on `urllib3`) and Streamlink's expected version.
fix
Upgrade Streamlink and its dependencies: `pip install --upgrade streamlink`. This typically resolves `urllib3` version mismatches.
[stream.hls][warning] Encountered a stream discontinuity. This is unsupported and will result in incoherent output data.
This usually indicates an issue with the HLS stream itself, where segments are not continuous or metadata changes unexpectedly, leading to corrupted output or incomplete recordings.
fix
This often points to a problem with the source stream. Try different stream qualities (`best`, `worst`, or specific resolutions). If recording, try adjusting `--hls-segment-threads` or `--hls-live-restart`. Sometimes, the issue resolves itself or is temporary.
streamlink: error: unrecognized arguments: <some-argument>
This error occurs when Streamlink's CLI parser encounters an argument it doesn't recognize. This often happens after major version updates where CLI arguments are changed or deprecated, or when an outdated configuration file passes invalid options.
fix
Review your Streamlink command-line arguments and any custom configuration files. Pay close attention to changes in how `--player` and `--player-args` work since version 6.0.0. Remove or update old config files. Run `streamlink --help` for current argument options.
Upgrade
Version history
8.4.0latest on PyPI · released May 6, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or newer.
urllib3requiredHTTP client library, required for network operations.
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
streamlink — pip install streamlink · libregistry