简体   繁体   中英

How can I download files from a Github repository without logging in?

I couldn't find anything online so that's why I'm posting it despite the question being simple.

I'm writing a script that download an application's binary and puts it in a file. I would like the use the PyGitHub API to retrieve some information. The problem is that I don't want to enter any credentials when accessing GitHub. I don't need to modify anything, I just want to download the latest release and get information on it. I tried to do it with request, but it's very complicated to use, especially if I only want specific files in the repo. Is there any way I can access the repo using the API without needing credentials?

You can simply pass nothing to the main class, to use the API without authenticating.

from github import Github

g = Github()
r = g.get_repo("REPO_USER/REPO_NAME")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM