Make the scripts lesss bad python (still python...)
This commit is contained in:
1 parent
3805685d8f
commit
b64ab023ea
30 files changed
+1979
-653
No files matched your search
@@ -1,3 +1,4 @@
|
||||
"""Catbox userhash loader and uploader (curl.exe wrapper)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
@@ -6,6 +7,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
def load_userhash(vault: Path) -> str:
|
||||
"""Load the catbox ``userhash`` from ``vault/secrets/credentials.toml`` (TOML or lenient line scan)."""
|
||||
path = vault / "secrets" / "credentials.toml"
|
||||
if not path.is_file():
|
||||
raise RuntimeError(f"missing {path}")
|
||||
@@ -31,6 +33,7 @@ def load_userhash(vault: Path) -> str:
|
||||
|
||||
|
||||
def upload_file(path: Path, userhash: str) -> str:
|
||||
"""Upload ``path`` to catbox.moe via curl.exe and return the public HTTPS URL."""
|
||||
cmd = [
|
||||
"curl.exe",
|
||||
"-sS",
|
||||
|
||||
Reference in new issue
Block a user