
https://raw.githubusercontent.com/[user]/repo/path/file
这个格式的网址长久可以访问的。
https://raw.githubusercontent.com/[user]/repo/path/file?token=xxxxxxxxxxxxxxxxx
这个是临时访问网址,过一会就不能访问了。
然后在网上找了一些格式,也不能访问,测试格式如下:
https://raw.githubusercontent.com/[user]/repo/path/file?token=OAUTH-TOKEN
https://[email protected]/[user]/repo/path/file
https://rawgit.com/[user]/repo/path/file?token=OAUTH-TOKEN
https://api.github.com/[user]/repo/path/file?access_token=OAUTH-TOKEN
https://api.github.com/[user]/repo/path/file?client_id=MY-CLIENT-ID&client_secret=MY-CLIENT-SECRET
如何像公开库一样( HTTP 方式),实现长久访问私有库的 raw 格式文件,请大佬赐教,或给个解决方法的链接。
谢谢!
谢谢各位回答。
本题需要的是:用浏览器就可以查看 GitHub 私有库文件 raw 格式的命令(不是命令行等方式)。
对于各位回答,我会一个一个测试,如果成功,会写出答案。
再次感谢!
1 U7Q5tLAex2FI0o0g 2019 年 10 月 22 日 |
2 ETiV 2019 年 10 月 22 日 via iPhone GitHub 貌似支持 http basic auth 的样子 生成一个 personal access token 访问用 https://[user]:[token]@github.com/blahblah 这种 URL,后面没有 query 参数 |
3 learnshare 2019 年 10 月 22 日 |
4 weioyi OP @learnshare 这个是用于公有库的。我需要的是用于私有库的。 |
5 dorentus 2019 年 10 月 23 日 via iPhone 用付费的 private repo 开 pages 提供 URL。 |
6 quicysver 2019 年 11 月 18 日 我最近也发现这个问题 不知道怎么解决 |
8 uniconhlp 2019 年 11 月 21 日 @weioyi Github 的 api 还没研究,不过目前 gitlab 的私有库查看 raw 文件格式倒是 OK 了: https://gitlab.com/api/v4/projects/:id/repository/files/yyyyy%2Fxxxxxx.conf/raw?ref=master&private_token=xxxxxxxxxxx exp:查看仓库 id:id 下的 yyyyy 目录中的 xxxxxx.conf 源文件。ref=master 必须选择分支。private_token 同 GitHub 一样申请。希望有用。 |
9 Levox 2020 年 4 月 4 日 楼主解决了吗? |
10 KhaosChow 2020 年 6 月 26 日 via Android 有人解决了吗? |
11 o0OoO0o 2020 年 11 月 28 日 同问,最后解决了吗? |
13 mjollnir 2020 年 12 月 31 日 我测试下来这种方法可行 curl https://[username]:[token]@raw.githubusercontent.com/[username]/[repo]/master/[xxxxxxx] |
14 weioyi OP |
15 Token3 2021 年 2 月 20 日 最近也遇到了这个问题,楼主最终解决这个问题了吗? |
17 jfgyjghrjry 2022 年 1 月 19 日 创建 oauth 令牌,raw 链接+?access_token=oauth 令牌即可 |
18 jfgyjghrjry 2022 年 1 月 19 日 @jfgyjghrjry 刚刚试了一下,好像不可以了♂ |
19 sunny2580839896 2022 年 4 月 29 日 解决了吗? |
20 Demoee 2022 年 7 月 16 日 via iPad 围观求个解决方案 |
21 qingyin 2022 年 7 月 18 日 via Android 现在还有人解决吗 |
22 VT2 2022 年 7 月 19 日 围观,也是试了半天都没有发现解决方案 |
23 geekyouth 2022 年 7 月 29 日 同求 |
24 eudemonwind 2022 年 9 月 1 日 把文件加密了传公有库? |
25 shindgewongxj 2022 年 9 月 1 日 `https://<Personal Access Tokens>@raw.githubusercontent.com/<username>/<reponame>/<branchname>/<path>/<filename>` |
26 levine 2022 年 10 月 6 日 @jfgyjghrjry 请问是 OAuth Apps 这个?还是 Personal access tokens 呢? |
27 levine 2022 年 10 月 6 日 请问有解决嘛?或者有没有其他可以实现的网站呢? |
28 levine 2022 年 10 月 7 日 @shindgewongxj 浏览器中操作不行哦。 |
29 jfgyjghrjry 2022 年 10 月 19 日 @levine 我重新回复了我自己,这个操作已经已经无法使用了 |
30 levine 2022 年 10 月 21 日 @jfgyjghrjry 谢谢。 |
31 yidongnan 2023 年 3 月 8 日 同求~ |
32 Dragonphy 2023 年 3 月 19 日 @sunny2580839896 #19 curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/acct/repo2/main/test.json https://github.com/orgs/community/discussions/27201#discussioncomment-3254986 |
33 sunny2580839896 2023 年 3 月 20 日 via iPhone @Dragonphy 谢谢,最后用 gist 解决了 |
34 yxmyxmyyy 2023 年 11 月 9 日 去 cf worker 搭一个反代,反代带上 token 请求头就行了 |
35 addenvex 2024 年 9 月 11 日 @sunny2580839896 gist 好像有时候,更新比较慢 |