PyDash2HLS
PyDash2HLS is a Python library that converts DASH (MPD) manifests into HLS (M3U8) playlists. It supports both local and remote DASH manifests, handles fragment extraction, and optionally embeds SAMPLE-AES encryption keys for protected content.
Features
- Parse DASH MPD files (local or remote)
- Extract video/audio profiles and fragment URLs
- Handle DRM information (Widevine & PlayReady)
- Convert DASH profiles to HLS playlists (.m3u8)
- Optional embedding of encryption keys in HLS (SAMPLE-AES-CTR)
- Works with
ffplayor any HLS-compatible player - Lightweight and Python-only solution
Installation
Install via pip:
pip install pydash2hls
Usage
Load a DASH Manifest
From a Remote URL
from pydash2hls.dash import Dash
url = "https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd"
dash = Dash.remote(method='GET', url=url)
From a Local File
from pathlib import Path
from pydash2hls.dash import Dash
file_path = Path("11331.mpd")
dash = Dash.load(file_path)
dash.url = "https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd"
Parse Fragments and DRM
dash.unpack() # Extracts profiles, fragments, and DRM info into dash.profiles
Convert DASH to HLS
profile_id = "1080_4800000" # Video profile ID
encryption_key = "KID:KEY" # Optional SAMPLE-AES-CTR key
hls_playlist = dash.convert(profile_id=profile_id, encryption_key=encryption_key)
# Save HLS playlist to disk
Path("index.m3u8").write_text(hls_playlist)
Play the Generated Playlist
ffplay -hide_banner -loglevel error -allowed_extensions ALL -protocol_whitelist file,http,https,tcp,tls,crypto,data index.m3u8
Contributors
Licensing
This project is licensed under the GPL v3 License. You can find a copy of the license in the LICENSE file in the root folder.
Metadata
Release files for pydash2hls 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydash2hls-3.0.0.tar.gz | 20.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydash2hls-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.8 kB
Release files / pydash2hls-3.0.0.tar.gz
| Download URL | pydash2hls-3.0.0.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc16044cd18634f71bfff36382495c9ce729de62ddb02520d8f9ee54599e6ce7
|
|
BLAKE2b-256 checksum How to use checksums |
9da8551ddd2df8e6274662178e39ff059ce797dff1f63998c170b3ae752927a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.11 Windows/10
|
Release files / pydash2hls-3.0.0-py3-none-any.whl
| Download URL | pydash2hls-3.0.0-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fa03a0c74ce0c2b1f6645d6668a995b54fd5db8fa42f217621045e39c0411a1
|
|
BLAKE2b-256 checksum How to use checksums |
bfc902c65af80798e3de7f61fa9ebe03787ffeeee66e2d7a64b5b9c047dda2b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.11 Windows/10
|