Python m3u8 parser
Project description
m3u8
Python m3u8 parser.
Documentation
Loading a playlist
To load a playlist into an object from uri, file path or directly from
string, use the load/loads
functions:
import m3u8
playlist = m3u8.load('http://videoserver.com/playlist.m3u8') # this could also be an absolute filename
print(playlist.segments)
print(playlist.target_duration)
# if you already have the content as string, use
playlist = m3u8.loads('#EXTM3U8 ... etc ... ')
Dumping a playlist
To dump a playlist from an object to the console or a file, use the
dump/dumps
functions:
import m3u8
playlist = m3u8.load('http://videoserver.com/playlist.m3u8')
print(playlist.dumps())
# if you want to write a file from its content
playlist.dump('playlist.m3u8')
Supported tags
- #EXT-X-TARGETDURATION
- #EXT-X-MEDIA-SEQUENCE
- #EXT-X-DISCONTINUITY-SEQUENCE
- #EXT-X-PROGRAM-DATE-TIME
- #EXT-X-MEDIA
- #EXT-X-PLAYLIST-TYPE
- #EXT-X-KEY
- #EXT-X-STREAM-INF
- #EXT-X-VERSION
- #EXT-X-ALLOW-CACHE
- #EXT-X-ENDLIST
- #EXTINF
- #EXT-X-I-FRAMES-ONLY
- #EXT-X-BITRATE
- #EXT-X-BYTERANGE
- #EXT-X-I-FRAME-STREAM-INF
- #EXT-X-IMAGES-ONLY
- #EXT-X-IMAGE-STREAM-INF
- #EXT-X-TILES
- #EXT-X-DISCONTINUITY
- #EXT-X-CUE-OUT
- #EXT-X-CUE-OUT-CONT
- #EXT-X-CUE-IN
- #EXT-X-CUE-SPAN
- #EXT-OATCLS-SCTE35
- #EXT-X-INDEPENDENT-SEGMENTS
- #EXT-X-MAP
- #EXT-X-START
- #EXT-X-SERVER-CONTROL
- #EXT-X-PART-INF
- #EXT-X-PART
- #EXT-X-RENDITION-REPORT
- #EXT-X-SKIP
- #EXT-X-SESSION-DATA
- #EXT-X-PRELOAD-HINT
- #EXT-X-SESSION-KEY
- #EXT-X-DATERANGE
- #EXT-X-GAP
- #EXT-X-CONTENT-STEERING
Frequently Asked Questions
Running Tests
$ ./runtests
Contributing
All contributions are welcome, but we will merge a pull request if, and only if, it
- Has tests
- Follows the code conventions
If you plan to implement a new feature or something that will take more than a few minutes, please open an issue to make sure we don't work on the same thing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
m3u8-5.1.0.tar.gz
(41.5 kB
view details)
Built Distribution
m3u8-5.1.0-py3-none-any.whl
(24.0 kB
view details)
File details
Details for the file m3u8-5.1.0.tar.gz
.
File metadata
- Download URL: m3u8-5.1.0.tar.gz
- Upload date:
- Size: 41.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b90c7c9ac15cf209bc901f2476396892085bf0f2b9bf86273db0e132811748 |
|
MD5 | 96cfbc539b09a0a86b10ab22a1c32697 |
|
BLAKE2b-256 | 9ac8e70335cc752f0a74c04707c75200a7515e49aa5290b0029f4499fa1b9369 |
File details
Details for the file m3u8-5.1.0-py3-none-any.whl
.
File metadata
- Download URL: m3u8-5.1.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e78e0898edf6d69cbcfb7000ad23b97e13bcfa7e82770d2f0a21b46221eed2 |
|
MD5 | aa1c6ef666cc03a3d2cef3df2d7fabc6 |
|
BLAKE2b-256 | eb3b9386dc40fc93237c6b9299c08faa5f447598ecd6b4ad2f389568e51764d0 |