Program to live stream m3u8 to rtmp in python (no ffmpeg and no function)
import subprocess import threading import shlex import os import sys import urllib import time import datetime def log(s): print('[%s][%s] %s' % (datetime.datetime.now(), threading.currentThread().getName(), s)) def runCmd(cmd): try: p = subprocess.Popen(shlex.split(cmd), stdout=sys.stdout, stderr=sys.stderr) return p except Exception as e: log("Error: " + str(e)) def getFile(url): try: tmp = urllib.request.urlopen(url) return tmp.readlines() except Exception as e: log("Error: " + str(e)) def getFile2(url): try: return urllib.request.urlopen(url).read() except Exception as e: log("Error: " + str(e)) def getFile3