Python m3u8 parser
Python m3u8 parser.
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')
All contribution is 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.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size m3u8-0.6.0-py3-none-any.whl (20.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size m3u8-0.6.0.tar.gz (22.4 kB)||File type Source||Python version None||Upload date||Hashes View|