PW Akshay


generate functionTue, 17 Jan 2023

create a python program to stream video from m3u8 url using moviepy.editor module

from moviepy.editor import VideoFileClip import argparse import subprocess def m3u8_to_mp4(m3u8_url, mp4_name):["ffmpeg", "-i", m3u8_url, "-c", "copy", mp4_name]) def main(): parser = argparse.ArgumentParser( description='Get a m3u8 url from a provider and download it as mp4' ) parser.add_argument( 'm3u8_url', help='m3u8 url from provider' ) parser.add_argument( 'mp4_name', help='name for the mp4 file' ) m3u8_to_mp4() if __name__ == '__main__': main()

Questions about programming?Chat with your personal AI assistant