From 3db4f93d776ac6a4e028f511016299dc58ba9027 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 15 Sep 2023 01:26:45 +0200 Subject: [PATCH] Solved api bug --- mirror.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mirror.py b/mirror.py index 24a6745..664b5f4 100644 --- a/mirror.py +++ b/mirror.py @@ -28,13 +28,18 @@ gitea_repos = set(repo['name'] for repo in response.json()) # Identify repos not yet mirrored on Gitea to_mirror = {name: url for name, url in github_repos.items() if name not in gitea_repos} +# Fetch the Gitea User ID +response = requests.get(f"https://git.veen.world/api/v1/users/{GITEA_USER}", headers=HEADERS) +response.raise_for_status() +gitea_user_id = response.json().get("id") + for name, url in to_mirror.items(): data = { - "clone_url": url, + "clone_addr": url, "mirror": True, "private": True, "repo_name": name, - "uid": GITEA_USER + "uid": gitea_user_id } response = requests.post(f"https://git.veen.world/api/v1/repos/migrate", headers=HEADERS, json=data) if response.status_code == 201: