PW Akshay


generate functionMon, 05 Dec 2022

Program to stream m3u8 link to rtmp in python using PyM3u8 .

#!/usr/bin/env python from pym3u8 import load from pysrt import SubRipFile from subprocess import Popen, PIPE from tempfile import NamedTemporaryFile from datetime import datetime import time import re import os m3u8_url = '' rtmp_url = 'rtmp://localhost/live' key = 'Q4B4Cw6n' def run_process(cmd): p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) out, err = p.communicate() return out, err def get_subtitles(subtitles_url): subtitles_url = subtitles_url.replace('\n', '').replace('\r', '') if subtitles_url: try: response = urllib2.urlopen(subtitles_url)

Questions about programming?Chat with your personal AI assistant