Skip to content

Instantly share code, notes, and snippets.

@SophieShears
SophieShears / dl_m3u8_multithreaded.py
Last active February 16, 2025 02:21
Download m3u8 links as mp4 multithreaded to decrease download time
# 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'
@SophieShears
SophieShears / dl_m3u8.py
Last active April 11, 2024 21:53
Download m3u8 links as mp4 with python
# 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)