为什么我有例外“ 403存储库访问使用Pygithub? 我正在尝试通过Pygithub进行废除github用户喜欢的编程语言,但是每次我想取消用户时都如此奇怪 - 我都会遵循“我都会遵循的“息态”: 追溯(大多数

问题描述 投票:0回答:2
#!/usr/bin/env python3 from github import Github ACCESS_TOKEN = 'my credential' client = Github(ACCESS_TOKEN, per_page=100) user = client.get_user('ELLIOTTCABLE') repo_list = [repo.name for repo in user.get_repos() if not repo.fork] print(repo_list) for j in repo_list: repo = user.get_repo(j) lang = repo.language print(j,':',lang)

403HTTP状态

表示禁止请求,因此您提供的凭据无法让您访问某些端点。
因此,在创建
Github
python python-3.x github github-api
2个回答
1
投票
用户 /密码

): #!/usr/bin/env python3 from github import Github ACCESS_USERNAME = 'username' ACCESS_PWD = "password" client = Github(ACCESS_USERNAME, ACCESS_PWD, per_page=100) user = client.get_user('ELLIOTTCABLE') repo_list = [repo.name for repo in user.get_repos() if not repo.fork] print(repo_list) for j in repo_list: repo = user.get_repo(j) lang = repo.language print(j,':',lang) 这应该很好。

如果您尝试访问由于DMCA

取下的存储库,则此错误消息还显示在Node.js Octokit上

这可能与原始问题无关,但是错误消息是相同的,因此希望它可以帮助像我这样的未来Google。 我已经在:
https://github.com/orgs/community/discussions/154227
中描述了我的调查,但长话短说,我是从官方的github node.js api请求中做的,例如:

const commits = await octokit.rest.repos.listCommits({ owner: 'duty-machine', repo: 'news', per_page: 1, })

0
投票
但存储库

Https://github.com/duty-machine/news几周前是DMCA'ED:Https:///github.com/github.com/github/github/dmca/dmca/blob/blob/master/2025/02/2025/02/2025-02/2025-02-27-sanlian-new-new-news.s.md----

octokit

在我的情况下解释了这个谜。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.