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 ffmpeg stream = ffmpeg.input('http://ip/live/ch1.m3u8') stream = ffmpeg.output(stream, 'rtmp://a.rtmp.youtube.com/live2/YOUR_KEY') ffmpeg.run(stream)