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 17:37:47 +08:00 ![]() |
![]() | 2 ETiV 2019-10-22 17:57:15 +08:00 via iPhone GitHub 貌似支持 http basic auth 的样子 生成一个 personal access token 访问用 https://[user]:[token]@github.com/blahblah 这种 URL,后面没有 query 参数 |
![]() | 3 learnshare 2019-10-22 18:39:45 +08:00 |
![]() | 4 weioyi OP @learnshare 这个是用于公有库的。我需要的是用于私有库的。 |
![]() | 5 dorentus 219-10-23 01:16:02 +08:00 via iPhone 用付费的 private repo 开 pages 提供 URL。 |
6 quicysver 2019-11-18 14:29:07 +08:00 我最近也发现这个问题 不知道怎么解决 |
8 uniconhlp 2019-11-21 21:38:46 +08:00 @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-04-04 12:52:48 +08:00 楼主解决了吗? |
10 KhaosChow 2020-06-26 22:47:34 +08:00 via Android 有人解决了吗? |
![]() | 11 o0OoO0o 2020-11-28 18:02:14 +08:00 同问,最后解决了吗? |
13 mjollnir 2020-12-31 16:41:32 +08:00 我测试下来这种方法可行 curl https://[username]:[token]@raw.githubusercontent.com/[username]/[repo]/master/[xxxxxxx] |
![]() | 14 weioyi OP |
15 Token3 2021-02-20 16:19:11 +08:00 最近也遇到了这个问题,楼主最终解决这个问题了吗? |
17 jfgyjghrjry 2022-01-19 08:54:42 +08:00 创建 oauth 令牌,raw 链接+?access_token=oauth 令牌即可 |
18 jfgyjghrjry 2022-01-19 08:59:21 +08:00 @jfgyjghrjry 刚刚试了一下,好像不可以了♂ |
![]() | 19 sunny2580839896 2022-04-29 16:13:44 +08:00 解决了吗? |
20 Demoee 2022-07-16 01:40:18 +08:00 via iPad 围观求个解决方案 |
![]() | 21 qingyin 2022-07-18 01:26:17 +08:00 via Android 现在还有人解决吗 |
22 VT2 2022-07-19 16:16:12 +08:00 围观,也是试了半天都没有发现解决方案 |
23 geekyouth 2022-07-29 15:04:25 +08:00 同求 |
24 eudemonwind 2022-09-01 06:58:51 +08:00 把文件加密了传公有库? |
![]() | 25 shindgewongxj 2022-09-01 14:11:05 +08:00 `https://<Personal Access Tokens>@raw.githubusercontent.com/<username>/<reponame>/<branchname>/<path>/<filename>` |
![]() | 26 levine 2022-10-06 14:43:17 +08:00 @jfgyjghrjry 请问是 OAuth Apps 这个?还是 Personal access tokens 呢? |
![]() | 27 levine 2022-10-06 14:44:40 +08:00 请问有解决嘛?或者有没有其他可以实现的网站呢? |
![]() | 28 levine 2022-10-07 09:52:26 +08:00 @shindgewongxj 浏览器中操作不行哦。 |
29 jfgyjghrjry 2022-10-19 13:21:46 +08:00 @levine 我重新回复了我自己,这个操作已经已经无法使用了 |
![]() | 30 levine 2022-10-21 17:08:15 +08:00 @jfgyjghrjry 谢谢。 |
31 yidongnan 2023-03-08 20:14:29 +08:00 同求~ |
![]() | 32 Dragonphy 2023-03-19 05:57:05 +08:00 @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-03-20 07:47:57 +08:00 via iPhone @Dragonphy 谢谢,最后用 gist 解决了 |
34 yxmyxmyyy 2023-11-09 23:33:22 +08:00 去 cf worker 搭一个反代,反代带上 token 请求头就行了 |
![]() | 35 addenvex 2024-09-11 11:08:47 +08:00 @sunny2580839896 gist 好像有时候,更新比较慢 |