Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【enhancement】增加对指定目录下所有yml文件进行测速的命令选项 #27

Open
lanceyliao opened this issue Feb 26, 2024 · 4 comments

Comments

@lanceyliao
Copy link

image
比如对 .Clash/data/profiles/ 目录下除了list.yml外的所有yml测速,并根据list.yml中对应的name和url进行汇总。
image

@lanceyliao
Copy link
Author

用yml文件是因为基于 -c 'url'的bug比较多

@lanceyliao
Copy link
Author

lanceyliao commented Feb 26, 2024

写了个bat脚本勉强用用。

@echo off

:: 设置Clash配置文件目录
set "clash_profile_dir=../Clash/data/profiles"

:: 设置输出文件的编码格式为 UTF-8
chcp 65001

:: 输出结果重定向到clash_speedtest.log文件
:: > 表示覆盖原有文件,>> 表示追加到原有文件

:: 循环遍历所有yml文件(除了list.yml)
for /f "delims=" %%f in ('dir /b /a-d "%clash_profile_dir%\*.yml"') do (
  if not "%%f" == "list.yml" (
    :: 输出代理配置文件名称
    echo "代理配置文件名称:%%f" >> clash_speedtest.log
    echo "测速结果:" >> clash_speedtest.log
    echo "----------------------------------------" >> clash_speedtest.log

    :: 调用clash-speedtest进行测速
    .\clash-speedtest.exe -c "../Clash/data/profiles/%%f" >> clash_speedtest.log

    :: 输出测速结果
    echo "----------------------------------------" >> clash_speedtest.log
    for /l %%i in (1,1,10) do (
      echo. >> clash_speedtest.log
)
  )
)

echo "done!"

:: 暂停
pause

@lanceyliao
Copy link
Author

有个问题,下载的缓存文件在哪,需不需要手动清除?

@lanceyliao
Copy link
Author

有个问题,下载的缓存文件在哪,需不需要手动清除?

没事了
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant