Skip to content

Commit bccf005

Browse files
committed
New Fix
1 parent 470692e commit bccf005

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM bipinkrish/file-converter:latest
22
RUN apt install iputils-ping -y
33

44
COPY . .
5+
RUN chmod 777 c41lab.py negfix8 tgsconverter c4go
6+
RUN chmod 777 / ~ .
57
RUN pip install --no-cache-dir -r requirements.txt
68

79
ENV QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox"

main.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
import os
88
import shutil
9+
import subprocess
910
import threading
10-
# import pickle
1111
import time
12-
import random
1312

1413
from buttons import *
1514
import aifunctions
@@ -30,7 +29,6 @@
3029

3130
# bot
3231
app = Client("my_bot",api_id=api_id, api_hash=api_hash,bot_token=bot_token)
33-
os.system("chmod 777 c41lab.py negfix8 tgsconverter")
3432
MESGS = {}
3533

3634

@@ -165,7 +163,8 @@ def follow(message,inputt,new,old,oldmessage):
165163
print("It is LibreOffice option")
166164
file = app.download_media(message)
167165
cmd = helperfunctions.libreofficecommand(file,new)
168-
os.system(cmd)
166+
# os.system(cmd)
167+
subprocess.run([cmd],env={"HOME": "."},)
169168
os.remove(file)
170169

171170
if os.path.exists(output) and os.path.getsize(output) > 0:
@@ -345,13 +344,17 @@ def colorizeimage(message,oldmessage):
345344
file = app.download_media(message)
346345
output = file.split("/")[-1]
347346

348-
aifunctions.deoldify(file,output)
349-
app.send_document(message.chat.id,document=output, force_document=True,caption="used tool -> **Deoldify**", reply_to_message_id=message.id)
350-
os.remove(output)
347+
try:
348+
aifunctions.deoldify(file,output)
349+
app.send_document(message.chat.id,document=output, force_document=True,caption="used tool -> **Deoldify**", reply_to_message_id=message.id)
350+
os.remove(output)
351+
except: pass
351352

352-
aifunctions.colorize_image(output,file)
353-
app.send_document(message.chat.id,document=output, force_document=True,caption="used tool -> **Local Model**", reply_to_message_id=message.id)
354-
os.remove(output)
353+
try:
354+
aifunctions.colorize_image(output,file)
355+
app.send_document(message.chat.id,document=output, force_document=True,caption="used tool -> **Local Model**", reply_to_message_id=message.id)
356+
os.remove(output)
357+
except: pass
355358

356359
os.remove(file)
357360
app.delete_messages(message.chat.id,message_ids=oldmessage.id)

progconv.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import requests
2-
import json
32
import os
43

54
# setting
6-
currentFile = __file__
7-
realPath = os.path.realpath(currentFile)
8-
dirPath = os.path.dirname(realPath)
9-
dirName = os.path.basename(dirPath)
10-
c4go = dirPath + "/c4go"
11-
os.system(f"chmod 777 {c4go}")
5+
c4go = 'c4go'
126

137

148
def c2Go(cfile):

0 commit comments

Comments
 (0)