PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 url to youtube in python

def stream(url): """ Program to stream m3u8 url to youtube in python """ import subprocess from pytube import YouTube from moviepy.editor import VideoFileClip # Download video from internet yt = YouTube(url) yt.streams.first().download() # Convert video to mp4 video = VideoFileClip(yt.title) video.write_videofile("video.mp4") # Upload video to youtube subprocess.call("youtube-upload --title=\"{}\" --client-secrets secrets.json --private video.mp4".format(yt.title), shell=True) # Delete video file subprocess.call("rm video.mp4", shell=True) stream("https://www.youtube.com/watch?v=S0LU-vbF1tk")

Questions about programming?Chat with your personal AI assistant