Update app.py
Browse files
app.py
CHANGED
|
@@ -1,42 +1,10 @@
|
|
| 1 |
-
import
|
| 2 |
-
import
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
name="x",
|
| 12 |
-
session_string=session_string
|
| 13 |
-
)
|
| 14 |
-
|
| 15 |
-
await app.start()
|
| 16 |
-
|
| 17 |
-
msg = await app.get_messages("nt123456nt", 28)
|
| 18 |
-
|
| 19 |
-
file_path = await msg.download()
|
| 20 |
-
print("Downloaded:", file_path)
|
| 21 |
-
|
| 22 |
-
with zipfile.ZipFile(file_path, "r") as z:
|
| 23 |
-
z.extractall("out")
|
| 24 |
-
|
| 25 |
-
print("Extracted to: out")
|
| 26 |
-
|
| 27 |
-
for root, _, files in os.walk("out"):
|
| 28 |
-
for f in files:
|
| 29 |
-
path = os.path.join(root, f)
|
| 30 |
-
|
| 31 |
-
print("\n---", f, "---")
|
| 32 |
-
|
| 33 |
-
try:
|
| 34 |
-
with open(path, "r") as file:
|
| 35 |
-
print(file.read())
|
| 36 |
-
except:
|
| 37 |
-
print("binary/unreadable")
|
| 38 |
-
|
| 39 |
-
await app.stop()
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
asyncio.run(main())
|
|
|
|
| 1 |
+
import shutil, json
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
for item in ["/data/image-shards", "/data/images_state.json"]:
|
| 5 |
+
p = Path(item)
|
| 6 |
+
if p.exists():
|
| 7 |
+
shutil.rmtree(p) if p.is_dir() else p.unlink()
|
| 8 |
+
print(f"✓ Deleted {item}")
|
| 9 |
+
else:
|
| 10 |
+
print(f" Skipped {item} — not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|