feat(immich): add immich-folder-album script,add restore user script
github: create albums from immich ext library folders restore deleted user script
This commit is contained in:
1 parent
00213a8f70
commit
4ff34458cc
4 files changed
+3694
No files matched your search
+7
@@ -0,0 +1,7 @@
|
||||
./immich_auto_album.py \
|
||||
--share-with "Mimi" \
|
||||
--share-role "editor" \
|
||||
--album-levels 3,7 \
|
||||
/library \
|
||||
https://fotos.someoneslinux.selfhost.eu/api \
|
||||
"gy78jOBMvwPNiTf8iHkllZa9H0lU9ir6oDDP1tzo1M" \
|
||||
Executable
+3635
File diff suppressed because it is too large.
Load diff
Executable
+7
@@ -0,0 +1,7 @@
|
||||
urllib3>=2.8.0
|
||||
pyyaml>=6.0.3
|
||||
regex>=2026.9.29
|
||||
tenacity>=9.2.1,<10.0.0
|
||||
# check https://github.com/timonrieger/immichpy/blob/main/COMPATIBILITY.csv
|
||||
# for the exact version to use that supports the server version you are using
|
||||
immichpy==9.2.4
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/home/lucas/scripts/.venv/bin/python
|
||||
|
||||
|
||||
import requests
|
||||
|
||||
IMMICH_URL = "https://fotos.someoneslinux.selfhost.eu/api"
|
||||
API_KEY = "I0vEVKsx89rlPv50xp1ZvZfP5jgApRSOGC9uR5Ekzc"
|
||||
USERNAME = "Mimi"
|
||||
|
||||
headers = {
|
||||
"x-api-key": API_KEY,
|
||||
"Accept": "application/json",
|
||||
}
|
||||
|
||||
# Find deleted user
|
||||
resp = requests.get(
|
||||
f"{IMMICH_URL}/admin/users",
|
||||
headers=headers,
|
||||
params={"withDeleted": "true"},
|
||||
)
|
||||
resp.raise_for_status()
|
||||
|
||||
users = resp.json()
|
||||
|
||||
user = next(
|
||||
(u for u in users if u.get("name") == USERNAME and u.get("status") == "deleted"),
|
||||
None,
|
||||
)
|
||||
|
||||
if not user:
|
||||
print(f"No deleted user named '{USERNAME}' found")
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
user_id = user["id"]
|
||||
|
||||
print(f"Restore user {USERNAME}: {user_id}")
|
||||
# Restore user
|
||||
resp = requests.post(
|
||||
f"{IMMICH_URL}/admin/users/{user_id}/restore",
|
||||
headers=headers,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
|
||||
print(f"Restored user '{USERNAME}' ({user_id})")
|
||||
Reference in new issue
Block a user