testsss / app.py
alptangall's picture
Update app.py
ed082c8 verified
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time,os,sys
import pickle
from random import randrange
import subprocess
from datetime import datetime,timedelta
import requests
import server
import gradio as gr
def greet(name):
print(111111)
VIDEO_OUTPUT_DIR = "output_videos"
MAIN_SCRIPT_PATH = "reddit.py"
profile_path = "./tiktok_profile"
cookie_file = "cookies.pkl"
if __name__ == "__main__":
try:
req=requests.get('http://0.0.0.0:7860')
print(req.status_code)
print('Client closed')
exit()
except Exception as err:
print(err)
process = subprocess.Popen(['python','/home/user/app/main.py'], stdout=subprocess.PIPE)
#server.b()
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(server_name="0.0.0.0", server_port=7860)
print('starting')
# Đóng trình duyệt sau khi hoàn thành
# driver.quit()
# Đóng trình duyệt sau khi hoàn thành
# driver.quit()