This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install m3u8_To_MP4 | |
# Code to download m3u8 links as mp4 files | |
import m3u8_To_MP4 | |
import os | |
def dl_m3u8(url, directory, filename): | |
# Note directory should be the filepath to save the file ex: '/home/username/bin' | |
# Directory can be a relative or absolute path | |
# Filename should end with an .mp4 ex: 'test.mp4' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First have to pip install "ffmpeg-python" | |
# Code to download m3u8 links as mp4 files | |
import ffmpeg | |
def dl_m3u8(dl_url, filepath): | |
try: | |
stream = ffmpeg.input(dl_url) | |
stream = ffmpeg.output(stream, f'{filepath}.mp4') | |
ffmpeg.run(stream) |