This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
是否有对 releases api 的支持 #19
Comments
|
所以是说 api.github.com 的代理吗 |
是的,但是改写里面的部分内容 |
我们正在考虑是否支持 API 以及如何支持 |
下面是我想到的一个用法,希望有帮助 #!/usr/bin/env python3
import os
import requests
import json
import subprocess
releasesInfo = requests.get(
'https://api.github.com/repos/haskell/haskell-language-server/releases').content
g = json.loads(releasesInfo)
for i in range(0, len(g[0]['assets'])-1):
g[0]['assets'][i]['browser_download_url'] = (
g[0]['assets'][i]['browser_download_url'].replace(
'https://github.com',
'https://download.fastgit.org'
)
)
# dump json onto the _base_path
with open('releasesInfo.json', 'w') as releasesInfoFile:
json.dump(g, releasesInfoFile, indent=4) |
感觉不需要做太多替换,可以看看 nginx-conf/hub.fastgit.org.conf Lines 40 to 48 in 379fbdd
|
Transferred to nginx-conf |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
https://docs.github.com/en/rest/reference/repos#releases
改写assets 中的 browser_download_url 到使用 download.fastgit.org 域
The text was updated successfully, but these errors were encountered: