HLS - hls everywhere - Download by python3 code how?

Read first:
https://en.wikipedia.org/wiki/M3U


The basic usage is to create a playlist object from uri, file path or directly from a string:
import m3u8

m3u8_obj = m3u8.load('http://videoserver.com/playlist.m3u8')  # this could also be an absolute filename
print m3u8_obj.segments
print m3u8_obj.target_duration

# if you already have the content as string, use

m3u8_obj = m3u8.loads('#EXTM3U8 ... etc ... ')


Supported tags:


  1. #EXT-X-TARGETDURATION
  2. #EXT-X-MEDIA-SEQUENCE
  3. #EXT-X-DISCONTINUITY-SEQUENCE
  4. #EXT-X-PROGRAM-DATE-TIME
  5. #EXT-X-MEDIA
  6. #EXT-X-PLAYLIST-TYPE
  7. #EXT-X-KEY
  8. #EXT-X-STREAM-INF
  9. #EXT-X-VERSION
  10. #EXT-X-ALLOW-CACHE
  11. #EXT-X-ENDLIST
  12. #EXTINF
  13. #EXT-X-I-FRAMES-ONLY
  14. #EXT-X-BYTERANGE
  15. #EXT-X-I-FRAME-STREAM-INF
  16. #EXT-X-DISCONTINUITY
  17. #EXT-X-CUE-OUT
  18. #EXT-X-CUE-OUT-CONT
  19. #EXT-X-CUE-IN
  20. #EXT-X-CUE-SPAN
  21. #EXT-OATCLS-SCTE35
  22. #EXT-X-INDEPENDENT-SEGMENTS
  23. #EXT-X-MAP
  24. #EXT-X-START
  25. #EXT-X-SERVER-CONTROL
  26. #EXT-X-PART-INF
  27. #EXT-X-PART
  28. #EXT-X-RENDITION-REPORT
  29. #EXT-X-SKIP
  30. #EXT-X-SESSION-DATA
  31. #EXT-X-DATERANGE



Wait...

Comments