PW Akshay

Generation

generate functionTue, 17 Jan 2023

create a python program to stream video from m3u8 url to youtube using python-ffmpeg-video-streaming module (do not create function)(do not use subprocess)

import youtube_dl import ffmpeg import sys import os url = 'http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8' ydl_opts = {} with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([url]) # os.system('ffmpeg -i "' + str(url) + '" -codec copy ' + str(sys.argv[1])+'.mp3 ') import pafy url = 'http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8' video = pafy.new(url) bestaudio = video.getbestaudio() bestaudio.download()

Questions about programming?Chat with your personal AI assistant