可以出一个详细使用教程吗?

#3 · closed · 11 comments

View on GitHub ↗

Heporis

包括GitHub action,推送到GitHub gist的流程。 在本地处理也报错,sites.yaml里的 group是指template.yaml里的proxy-groups?需要为每一个代理组写一段筛选参数? ![image](https://github.com/nonPointer/ClashHelper/assets/51895154/decd5a6c-5277-42a0-91cc-776d747e1d70) 还请出个详细教程,谢谢!

Comments

nonPointer

Github Action 配置如下 ```yaml name: Deploy to Gist on: push: schedule: - cron: "0 */8 * * *" jobs: process: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: wget https://raw.githubusercontent.com/nonPointer/ClashHelper/master/helper.py -O helper.py - run: python3 helper.py template.yaml Clash.yml | tee run.log - name: Deploy uses: exuanbo/actions-deploy-gist@v1 with: token: ${{ secrets.TOKEN }} gist_id: [gist id] file_path: [文件名] file_type: binary ``` 创建一个自己账号下具有 Gist 读写权限的 API Token,设置到 repo 的 secrets 的 `TOKEN` 字段。 > sites.yaml 里的 group 是指 template.yaml 里的 proxy-groups 是的。你可以把多个来源的节点塞到同一个组里,也可以分为不同的组。配合分流规则,让流媒体走高质量(贵)的节点,上网走普通节点。 > 需要为每一个代理组写一段筛选参数 目前是的。你可以二次开发,根据需求进行修改。

Heporis

这个报错是什么问题? ![image](https://github.com/nonPointer/ClashHelper/assets/51895154/0405464c-fad9-453e-af86-5222447927fa)

nonPointer

你的配置模板 `template.yaml` 里缺少 `proxies:` [看这里](https://github.com/nonPointer/ClashHelper/blob/40b6014437f492eddb5fa0904c00cc20d9649897/template.yaml#L125C1-L125C9) 这个项目的行为是:解析订阅链接,并过滤节点。然后将节点塞到 `proxies` 和预设的分组内(见 L124-125)。

nonPointer

把模板里的 `proxies:` 改成 `proxies: []` 试试

Heporis

可以了 但是生成的配置里面的中文都是Unicode编码,比如✈️自动测速,变成了\u2708\uFE0F\u81EA\u52A8\u6D4B\u901F,能不能加个编码转换啊?

nonPointer

不用担心,你的客户端可以正常解析并显示 Unicode 的

Heporis

这个我知道,但是有时候会用外部编辑器打开配置,就会很困惑🤣

nonPointer

加上了 `allow_unicode=True`,你再试试新的文件。

Heporis

可以了,谢谢!

Heporis

针对同一个group拥有多个连接的情况,需要每个链接写一个筛选,可否优化成1个url中添加多个链接? dedup全部设置成True,proxies还是有很多重复节点

Heporis

生成的配置文件里的顺序都被重置了,能改成ruamel.yaml来维持原来的顺序吗?