From 3bb1ee694bdeee851f538887c9bf1e1200c0ec6c Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 10 Feb 2026 20:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0github=20API?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E4=BB=93=E5=BA=93=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gfdgd_xi <3025613752@qq.com> --- sync-gitee-to-github/sync.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sync-gitee-to-github/sync.py b/sync-gitee-to-github/sync.py index d8ce78a..45499f5 100644 --- a/sync-gitee-to-github/sync.py +++ b/sync-gitee-to-github/sync.py @@ -50,16 +50,11 @@ def sync(i): os.system(f"rm -rf '{programPath}/git-clone/{i}.git'") thread -= 1 -data = requests.get("https://github.com/orgs/GXDE-OS/repos_list?q=&page=1", headers=dataHeaders).json() -# 获取页数 -page = int(data["pageCount"]) +data = requests.get("https://api.github.com/users/GXDE-OS/repos", headers=dataHeaders).json() repoList = [] # 获取仓库列表 -for i in range(1, page + 1): - pageData = requests.get(f"https://github.com/orgs/GXDE-OS/repos_list?q=&page={i}", headers=dataHeaders).json() - repositories = pageData["repositories"] - for j in repositories: - repoList.append(j["name"]) +for i in data: + repoList.append(i["name"]) # 多线程处理以提升速度 thread = 0 threadMax = 32