Streamgrabber — IMDb/StreamIMDb HLS/M3U8 Video Downloader
streamgrabber is a Python CLI stream downloader for movies and TV shows. Paste an IMDb, StreamIMDb, embed, or web video URL and it can auto-detect HLS/M3U8/DASH streams, subtitles, seasons, episodes, and mux the download to MKV with ffmpeg.
It is designed for Stream Detector-style workflows where the browser URL may stay fixed while the player internally changes episodes, sources, signed stream URLs, or subtitle tracks.
If Streamgrabber saves you time, consider giving the repo a star ⭐
Quick examples
streamgrabber 'https://www.imdb.com/title/tt0096895'
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --quality 720 --subtitle-lang tr
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --episodes
What Streamgrabber does
- IMDb / StreamIMDb video downloader for movies and TV series.
- HLS/M3U8 stream downloader with browser header preservation.
- Season and episode downloader for fixed-URL players.
- Subtitle downloader, matcher, syncer, converter, and MKV muxer.
- CLI workflow powered by Playwright, streamlink, yt-dlp, ffmpeg, and ffsubsync.
Features
- Captures
.m3u8,.mpd,.vtt,.srtrequests from dynamic web/player pages. - Preserves important request headers such as
User-AgentandReferer. - Uses
streamlinkby default for HLS downloads. - Supports
yt-dlpas an alternate downloader. - Uses
ffmpegto mux output to.mkv. - Automatically selects best quality if you do not pass
--quality. - Automatically generates the output filename if you do not pass
--output. - For supported TV players, can list/download a specific episode or an entire season.
- Handles fixed-URL players where episode changes happen through an internal API rather than the browser URL.
- Accepts direct StreamIMDB embeds, IMDb title URLs, or bare IMDb IDs such as
tt0096895. - Can search, download, convert, and mux matching subtitles such as Turkish (
--subtitle-lang tr).
Requirements
- Python 3.11+
- Playwright Chromium
streamlinkyt-dlpoptional but recommendedffmpeg/ffprobeffsubsyncfor automatic subtitle synchronization
Check the local setup:
streamgrabber doctor
Expected checks:
ffmpeg OK
ffprobe OK
streamlink OK
yt-dlp OK
ffsubsync OK
playwright chromium OK
If Playwright Chromium is missing:
cd streamgrabber
source .venv/bin/activate
python -m playwright install chromium
Command name
Use the primary command:
streamgrabber
Installations from this repository expose streamgrabber. If your shell still runs an older Node prototype, remove or overwrite that old executable from your PATH.
Basic usage
Supported input forms
You can pass a direct embed URL:
streamgrabber 'https://streamimdb.ru/embed/movie/tt0096895'
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476'
You can also pass an IMDb title URL:
streamgrabber 'https://www.imdb.com/title/tt0096895'
Or just the IMDb ID:
streamgrabber tt0096895
For IMDb inputs, the tool resolves to the matching StreamIMDB embed automatically. For example:
https://www.imdb.com/title/tt0096895
-> https://streamimdb.ru/embed/movie/tt0096895
IMDb movie example
List streams for Batman 1989 from IMDb:
streamgrabber 'https://www.imdb.com/title/tt0096895' --list
Download it with defaults:
streamgrabber 'https://www.imdb.com/title/tt0096895'
Defaults still apply:
- quality:
best - output filename: automatic
Example automatic output:
Batman 1989.mkv
List detected streams
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --list
This prints the captured HLS URL, available quality variants, detected subtitles, source name, and planned output path.
Download without specifying quality or filename
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476'
Defaults:
- quality:
best - output: automatically generated from the detected source/title
- container:
.mkv
Example automatic output name:
Better Call Saul 2015 1-1.mkv
For TV episode API mode, automatic names use clean season/episode format:
Better Call Saul 2015 S01E02.mkv
Download best quality explicitly
This is equivalent to omitting --quality:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --quality best
Download a specific quality
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --quality 720
or:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --quality 360
Manually choose output filename
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --quality 720 --output 'Better Call Saul S01E01.mkv'
Short options also work:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' -q 720 -o 'Better Call Saul S01E01.mkv'
Short test download
Useful before downloading a full episode:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --quality 360 --duration 00:00:10 --output sample.mkv
Print commands without downloading
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --print-command
or:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --commands
TV season / episode mode
Some players keep the browser URL fixed while the user changes episode inside the player. For example:
https://streamimdb.ru/embed/tv/tt3032476
The URL remains the same, but the player internally calls an API with season and episode parameters. streamgrabber supports this.
List all available seasons and episodes
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --episodes
Example result:
{
"title": "Better Call Saul 2015",
"episodes": {
"1": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
"2": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
"6": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]
}
}
List one season
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --list
Example:
{
"title": "Better Call Saul 2015",
"season": 1,
"episodes": [1,2,3,4,5,6,7,8,9,10]
}
Download one episode
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --episode 2
Default output:
Better Call Saul 2015 S01E02.mkv
Download one episode with quality
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --episode 2 --quality 720
Download an entire season
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes
Each episode download is retried on transient CDN/timeout failures. On retry, the tool asks the player API for a fresh signed stream URL before calling streamlink again.
Useful retry controls:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --download-retries 5
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --stop-on-error
By default, --all-episodes continues to the next episode after retries are exhausted and reports failed episode numbers at the end. Re-run the same command later to retry missing/failed files.
This downloads every episode in S01 sequentially, generating filenames like:
Better Call Saul 2015 S01E01.mkv
Better Call Saul 2015 S01E02.mkv
Better Call Saul 2015 S01E03.mkv
...
Better Call Saul 2015 S01E10.mkv
Download an entire season at 720p
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --quality 720
Download an entire season with Turkish subtitles
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --quality 720 --subtitle-lang tr
For each episode, the tool checks player-provided default subtitles first. If none match the requested language, it searches OpenSubtitles, prefers subtitle releases that match the actual video release/source (for example BluRay x264 over a high-download WEBRip subtitle), automatically syncs the subtitle to the downloaded video audio with ffsubsync, converts SRT to WebVTT when needed, and muxes it into the MKV.
Download an entire season into a directory
mkdir -p downloads/better-call-saul-s01
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --all-episodes --quality best --output downloads/better-call-saul-s01
When --output is a directory path in season mode, every episode is saved there with an automatic filename.
Subtitles
Use --subtitle-lang / --sub-lang to download and mux a matching subtitle.
Turkish movie example:
streamgrabber 'https://www.imdb.com/title/tt0096895' --subtitle-lang tr
Turkish TV episode example:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --episode 2 --subtitle-lang tr
Subtitle sync is enabled by default. Useful controls:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --episode 2 --subtitle-lang tr --no-sync-subtitles
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --season 1 --episode 2 --subtitle-lang tr --subtitle-offset -1.5
--no-sync-subtitlesdisablesffsubsyncand muxes the selected subtitle as-is.--subtitle-offset SECONDSapplies an extra fixed offset; negative values make subtitles earlier, positive values make them later.--subtitle-sync-max-duration SECONDSlimits ffsubsync analysis for short tests/debugging.
Accepted Turkish values:
tr
tur
turkish
türkçe
How subtitle matching works:
- Extracts the IMDb ID from the input.
- Fetches the StreamIMDB/VaPlayer metadata for the selected movie or episode.
- Reads the actual upstream video release filename from
data.file_name. - Checks
default_subsfrom the player API first and uses the requested language if available. - If there is no matching default subtitle, searches the OpenSubtitles REST endpoint.
- For TV episodes, searches with
seasonandepisode. - Scores candidates against the video release name, prioritizing sync-critical signals:
- source/release type:
BluRay,WEBRip,WEB-DL,HDTV - season/episode:
S01E02 - codec:
x264,x265 - resolution:
1080p,720p - title/year/release-group matches
- source/release type:
- Uses download count only as a small tiebreaker/fallback, not as the main selector.
- Downloads the selected subtitle (
.gzfrom OpenSubtitles when needed). - Decodes the subtitle with the advertised encoding, e.g.
UTF-8orCP1254for Turkish. - Converts SRT to WebVTT.
- Runs
ffsubsyncagainst the downloaded video/audio to correct fixed offsets and framerate drift. - Applies any extra
--subtitle-offsetrequested by the user. - Muxes the synced subtitle into the final
.mkvas a subtitle stream.
Verify subtitle muxing with:
ffprobe -v error -select_streams s -show_entries stream=index,codec_name,codec_type -of json 'output.mkv'
Expected subtitle stream:
{
"codec_name": "webvtt",
"codec_type": "subtitle"
}
Downloader options
Default downloader:
streamlink
Use yt-dlp instead:
streamgrabber 'https://streamimdb.ru/embed/tv/tt3032476' --downloader yt-dlp --output video.mkv
For most captured HLS streams, streamlink is the recommended default.
Browser behavior
The tool starts with a headless Playwright browser.
If headless mode does not capture a stream, it automatically retries with an automated visible browser window.
Disable the fallback:
streamgrabber 'URL' --no-fallback
Force visible browser mode:
streamgrabber 'URL' --headed --list
Output naming
If you do not pass --output, streamgrabber tries to generate a useful .mkv filename automatically.
Normal capture mode:
- Finds the iframe/frame that emitted the HLS/DASH request.
- Reads visible source/player text from that frame.
- Filters noise like
Player,S01,E01,S01E01, timestamps, ad labels, and control labels. - Uses the best source name it finds.
- Falls back to useful title text if needed.
TV episode API mode:
- Uses the show title from the API.
- Adds
SxxExxautomatically.
Example:
Better Call Saul 2015 S01E02.mkv
Verified sample
The URL below was verified during development:
https://streamimdb.ru/embed/tv/tt3032476
Verified behavior:
- HLS master playlist captured
- Variants found: 360p and 720p
- Best quality is selected by default
- S01 episode list detected
- S01E02 short sample downloaded and muxed
- Turkish subtitle search/download/mux verified with
--subtitle-lang tr - Subtitle release matching verified: BluRay video prefers BluRay subtitle over high-download WEBRip/NF subtitle
- Automatic subtitle sync path verified with
ffsubsync ffprobeconfirmed video/audio/subtitle streams
Sample ffprobe result from a short S01E02 test:
Video: 640x360
Audio: AAC
Subtitle: WebVTT
Duration: ~5s
Container: MKV
Development
Run tests:
cd streamgrabber
source .venv/bin/activate
pytest -q
Expected at the time of writing:
39 passed
Notes
- Signed
.m3u8URLs can expire, so the tool fetches fresh episode stream URLs immediately before downloading. - DRM-protected streams are not supported.
- Use this tool only for content you are authorized to access and download.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamgrabber-0.1.0.tar.gz.
File metadata
- Download URL: streamgrabber-0.1.0.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e19271203af37d010a5309e83418f6019090b49efd5577748a702068641cf19a
|
|
| MD5 |
4dffce98259672ef57eb35b7f7a0db19
|
|
| BLAKE2b-256 |
612c4f81a4c8aaf2de480de9f5874d6107b2f6542f5cd1fdd21fd1ca74913933
|
File details
Details for the file streamgrabber-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamgrabber-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
404778742bac7e1711b8b8af3878684a6af20d99e3ffe93234f46641fcd9f82c
|
|
| MD5 |
0a51503ef65c8e8cc155fe6029fcf30b
|
|
| BLAKE2b-256 |
b063087c8cb623db7b5b607064c23c141506f8bdcae282ac9d8d379c0b83dbf4
|