download video by m3u8 url
Here is a substitute that supported asynchronous way
aiom3u8
m3u8ToMp4 is available on PyPI:
$ python -m pip install m3u8ToMp4
# Using a mirror
$ python -m pip install m3u8ToMp4 -i https://pypi.tuna.tsinghua.edu.cn/simple
import m3u8ToMp4
m3u8ToMp4.download("https://demo.com/demo/demo.m3u8", "C:\\videos", "video_name") #using default config
m3u8ToMp4.download("https://demo.com/demo/demo.m3u8", "C:\\videos", "video_name",
folder_need=False, download_queue_length=500, detect_queue_time=5,
single_delete_length=200, auto_bitrate=True, auto_bitrate_level="HIGHEST") #using adjustment params
OR
import m3u8ToMp4
m3u8ToMp4.download_console()
#Then type params by console
folder_need
: bool - Whether you need a folder to contain the target videodownload_queue_length
: int - The number of threads to download the videodetect_queue_time
: int - The cooldown of replenishing the new threads to replace the threads that have completed the target in secondssingle_delete_length
: int - The number of slices merged at one timeauto_bitrate
: bool - Whether you need a automatic selection if it has several options in video qualityauto_bitrate_level
: str - The video quality in automatic selection, "HIGHEST" and "LOWEST" only
auto_bitrate
and auto_bitrate_level
need to be used together
- Find new m3u8 url automatically
- Find new ts file suffix if it is changed
- User select the video quality if it has several options - (called by download_console or setting auto_bitrate = False in download)
- Video quality automatic selection - (effected by setting auto_bitrate and auto_bitrate_level)
- AES-128-CBC Decrypt
- Multi-threading
- Random Proxies - reduce the odds of detecting