PW Akshay


generate functionMon, 05 Dec 2022

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

import pym3u8 import requests import ffmpeg import os url = "file:///home/prajwala/Downloads/hls/master.m3u8" os.environ["http_proxy"] = "" os.environ["https_proxy"] = "" m3u8 = pym3u8.load(url) for playlist in m3u8.playlists: print(playlist.absolute_uri) stream = ffmpeg.input(str(playlist.absolute_uri)) stream = ffmpeg.output(stream, 'rtmp://[stream-key]', rtmp_live='live', rtmp_conn='S:123456', rtmp_app='rtmp://[stream-key]')

Questions about programming?Chat with your personal AI assistant