PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 url to youtube in python using PyM3u8 .

import pym3u8 import cv2 import youtube_dl def download_video(url, quality): video_url = url ydl_opts = { 'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([video_url]) print('Downloaded in Quality ' + quality) if __name__ == '__main__': # url = 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8' url = 'http://103.13.0.171:8081/hls/test.m3u8' stream = pym3u8.load(url) quality = '480' while True: video_path = stream.segments[

Questions about programming?Chat with your personal AI assistant