def start_stream(url): while len(sys.argv) > 1: sys.argv.pop() sys.argv.extend([ "-l", "debug", "--player-external-http", "--player-external-http-port", "8000", url, "best", ]) print(repr(sys.argv)) from streamlink_cli.main import main try: main() except SystemExit: sys.stderr.write("Cannot start stream. waiting 30 seconds\n") time.sleep(30)
if __name__ == "__main__": from streamlink_cli.main import main main()