node2 / app.py
panel1000's picture
Update app.py
07cde7c verified
import gradio as gr
import subprocess
import sys
import os
import signal
subprocess.run('apt-get install nodejs -y', shell=True)
subprocess.run('apt-get install npm -y', shell=True)
subprocess.run('apt-get install htop -y', shell=True)
subprocess.run('apt-get install nano -y', shell=True)
subprocess.run('apt-get install ffmpeg -y', shell=True)
subprocess.run('python3 -m pip install --upgrade git+https://github.com/WesleySouto/streamlink.git', shell=True)
subprocess.run('wget -O /usr/local/lib/python3.10/site-packages/streamlink/plugin/api/http_session.py http://$host/hug/http_session.py ', shell=True)
subprocess.run('wget -O /home/user/app/server3.js http://$host/panel1000/server3.js ', shell=True)
subprocess.run('wget -O /home/user/app/users.json http://$host/panel1000/users.json ', shell=True)
subprocess.run('wget -O /home/user/app/profiles.json http://$host/panel1000/profiles.json ', shell=True)
subprocess.run('wget -O /home/user/app/streams.json http://$host/panel1000/streams.json ', shell=True)
subprocess.run('npm install express', shell=True)
subprocess.run('npm install cors', shell=True)
subprocess.run('npm install fluent-ffmpeg', shell=True)
subprocess.run('npm install node-fetch', shell=True)
subprocess.run('npm install multer', shell=True)
subprocess.run('npm install body-parser', shell=True)
subprocess.run('cd /home/user/app', shell=True)
subprocess.run('nohup node /home/user/app/server3.js> nodenodenode.out 2>&1 &', shell=True)
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
subprocess.run('pip install jupyterlab', shell=True)
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()