Update app.py
Browse files
app.py
CHANGED
|
@@ -47,11 +47,7 @@ async def generate_dll(
|
|
| 47 |
except Exception:
|
| 48 |
pass
|
| 49 |
|
| 50 |
-
#
|
| 51 |
-
dll_path = os.path.join(output_dir, "DummyDll", "Assembly-CSharp.dll")
|
| 52 |
-
if not os.path.exists(dll_path):
|
| 53 |
-
dll_path = os.path.join(output_dir, "DummyDlls", "Assembly-CSharp.dll") # Ne olur ne olmaz diye yedeği
|
| 54 |
-
|
| 55 |
try:
|
| 56 |
process = subprocess.run([
|
| 57 |
"/app/dumper/Il2CppDumper",
|
|
@@ -60,12 +56,18 @@ async def generate_dll(
|
|
| 60 |
output_dir
|
| 61 |
], capture_output=True)
|
| 62 |
except subprocess.CalledProcessError as e:
|
| 63 |
-
pass #
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
else:
|
| 68 |
-
return {"error": "İşlem başarısız.", "details": "DLL dosyası bulunamadı."}
|
| 69 |
|
| 70 |
@app.post("/extract")
|
| 71 |
async def extract_dialogues(
|
|
|
|
| 47 |
except Exception:
|
| 48 |
pass
|
| 49 |
|
| 50 |
+
# 1. ÖNCE PROGRAMI ÇALIŞTIRIYORUZ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
try:
|
| 52 |
process = subprocess.run([
|
| 53 |
"/app/dumper/Il2CppDumper",
|
|
|
|
| 56 |
output_dir
|
| 57 |
], capture_output=True)
|
| 58 |
except subprocess.CalledProcessError as e:
|
| 59 |
+
pass # Hata verse bile dosyayı ürettiğini loglardan görmüştük, bu yüzden devam ediyoruz.
|
| 60 |
|
| 61 |
+
# 2. İŞLEM BİTTİKTEN SONRA DOSYAYI ARIYORUZ (S veya S'siz iki ihtimali de ekledik)
|
| 62 |
+
dll_path_1 = os.path.join(output_dir, "DummyDll", "Assembly-CSharp.dll")
|
| 63 |
+
dll_path_2 = os.path.join(output_dir, "DummyDlls", "Assembly-CSharp.dll")
|
| 64 |
+
|
| 65 |
+
if os.path.exists(dll_path_1):
|
| 66 |
+
return FileResponse(dll_path_1, media_type="application/octet-stream", filename="Assembly-CSharp.dll")
|
| 67 |
+
elif os.path.exists(dll_path_2):
|
| 68 |
+
return FileResponse(dll_path_2, media_type="application/octet-stream", filename="Assembly-CSharp.dll")
|
| 69 |
else:
|
| 70 |
+
return {"error": "İşlem başarısız.", "details": "DLL dosyası klasörde bulunamadı."}
|
| 71 |
|
| 72 |
@app.post("/extract")
|
| 73 |
async def extract_dialogues(
|