Sub-Store 小课堂: 使用文件功能, 实现多加速服务拉取 GitHub 资源
1. 创建文件(按图操作)
2. 脚本部分 见此文件
已经配置了默认的 GitHub 加速服务和参数
3. 使用时
a. $options 为通过链接传入的参数
例如: { arg1: 'a', arg2: 'b' }
先这样处理 encodeURIComponent(JSON.stringify({ arg1: 'a', arg2: 'b' }))
然后这样用 /api/file/foo?$options=%7B%22arg1%22%3A%22a%22%2C%22arg2%22%3A%22b%22%7D
b. 或这样处理 encodeURIComponent('arg1=a&arg2=b')
然后这样用 /api/file/foo?$options=arg1%3Da%26arg2%3Db
例如:
{ url: 'https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/ligeicon.json' }
->
/api/file/fetch?$options=%7B"url"%3A"https%3A%2F%2Fraw.githubusercontent.com%2Flige47%2FQuanX-icon-rule%2Fmain%2Fligeicon.json"%7D
同时兼容 $arguments. 但是用的时候, 需要你自己改了.
4. 其他参数
支持 timeout , headers 等参数, 会覆盖默认参数. 也可以直接修改脚本里的默认参数
🤭 Sub-Store 合集 🧐 频道资源合集 😄 恰饭推荐 💬 群组
🥰 #SubStore #Sub-Store #小课堂 #tips #加速 #GitHub #下载 #拉取 #文件 #脚本
1. 创建文件(按图操作)
2. 脚本部分 见此文件
已经配置了默认的 GitHub 加速服务和参数
3. 使用时
a. $options 为通过链接传入的参数
例如: { arg1: 'a', arg2: 'b' }
先这样处理 encodeURIComponent(JSON.stringify({ arg1: 'a', arg2: 'b' }))
然后这样用 /api/file/foo?$options=%7B%22arg1%22%3A%22a%22%2C%22arg2%22%3A%22b%22%7D
b. 或这样处理 encodeURIComponent('arg1=a&arg2=b')
然后这样用 /api/file/foo?$options=arg1%3Da%26arg2%3Db
例如:
{ url: 'https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/ligeicon.json' }
->
/api/file/fetch?$options=%7B"url"%3A"https%3A%2F%2Fraw.githubusercontent.com%2Flige47%2FQuanX-icon-rule%2Fmain%2Fligeicon.json"%7D
同时兼容 $arguments. 但是用的时候, 需要你自己改了.
4. 其他参数
支持 timeout , headers 等参数, 会覆盖默认参数. 也可以直接修改脚本里的默认参数
🤭 Sub-Store 合集 🧐 频道资源合集 😄 恰饭推荐 💬 群组
🥰 #SubStore #Sub-Store #小课堂 #tips #加速 #GitHub #下载 #拉取 #文件 #脚本