hls-client
This is a simple Python HTTP Live Streaming Client. It consumes a list of remote playlists, and saves all needed files to serve the playlist locally: the key, segments, and a modified m3u8 with paths normalized.
It also supports backups, i.e., if the same playlist is available on more than one server, it will track each server status and will switch to the backup if needed.
Through the config.ini it’s possible to customize where the files will be saved and what is the URL that provides servers info via JSON.
The JSON must be something like:
{
"streams": [
"nasa": {
"input-path": "/msfc/Edge.m3u8",
servers: [
"http://liveips.nasa.gov.edgesuite.net"
]
}
]
}
Variant Playlist Generation
hlslcient can consume multiple playlists and generate a variant playlists grouping then.
To do so, include a bandwidth for each stream and add an action to combine them in the JSON:
{
"streams": {
"Nasa-low": {
"input-path": "/msfc/Edge.m3u8",
"servers": ["http://liveips.nasa.gov.edgesuite.net"],
"bandwidth": 254082
},
"Nasa-medium": {
"input-path": "/msfc/3G.m3u8",
"servers": ["http://liveips.nasa.gov.edgesuite.net"],
"bandwidth": 460658
},
"Nasa-high": {
"input-path": "/msfc/Wifi.m3u8",
"servers": ["http://liveips.nasa.gov.edgesuite.net"],
"bandwidth": 1080434
}
},
"actions": [
{
"type": "combine",
"input": ["Nasa-low", "Nasa-medium", "Nasa-high"],
"output": "/msfc/nasa_mbr.m3u8"
}
]
}
Encryption
If you set encryption=true in the config file, hlsclient will automatically encrypt all streams with a random AES-128 cipher.
Running
To run the client, simply run:
$ python -m hlsclient
Running tests
We use py.test for testing.
$ py.test
Metadata
Release files for hlsclient 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hlsclient-0.2.5.tar.gz | 10.5 kB | Details |
Release files / hlsclient-0.2.5.tar.gz
| Download URL | hlsclient-0.2.5.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d701aa8077d19bd04a5e814736836e8e733dc72a676eee42c71a100c9742e1cc
|
|
BLAKE2b-256 checksum How to use checksums |
f7003e6574fbc5e8457d3e9d8f400a1bcdbb875df5e0729d1004782b4eb465c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |