-
Notifications
You must be signed in to change notification settings - Fork 2
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
debian12无法运行 #3
Comments
你找到那个函数,在fastcdn.py里面 |
抱歉这么晚回复,因为发完之后我想换成ubuntu试试,但紧接着电脑又坏了。 /bin/bash: -c: line 1: `./CloudflareST -f ./tmp/ipv4.txt -o ./tmp/result.csv -p 0 -httping -cfcolo HKG -n 200 # 延迟测速线程;越多延迟测速越快,但可能会被识别成网络扫描,最多 1000 -t 4 # 延迟测速次数;单个 IP 延迟测速的次数;(默认 4 次) -dn 20 # 下载测速数量;延迟测速并排序后,从最低延迟起下载测速的数量;(默认 10 个) -dt 10 # 下载测速时间;单个 IP 下载测速最长时间,不能太短;(默认 10 秒) -tp 443 -url https://cf.xiu2.xyz/url # 指定测速地址;延迟测速(HTTPing)/下载测速时使用的地址,默认地址不保证可用性,建议自建 -tl 300 -tll 20 -tlr 0.3 # 丢包几率上限;只输出低于/等于指定丢包率的 IP,范围 0.00~1.00,0 过滤掉任何丢包的 IP;(默认 1.00) -sl 3 ' 我认为是config.yaml里注释造成的,将CFST的注释删掉后稀里糊涂的继续运行了。 还有不管是你博客里的还是git clone的,示例的yaml都过不了语法验证,因为缩进有问题,将缩进全部换成空格的才能通过。 |
可能是你的配置文件有问题,一般来说是不会读到后面注释的部分的,在shell运行把注释当成参数了,肯定有问题 |
应该是吧,但我也不想折腾了,感谢你的开源项目,目前用着很方便,感谢 |
执行 python main.py
报错:
Traceback (most recent call last):
File "/opt/FastCDN/main.py", line 95, in
main()
File "/opt/FastCDN/main.py", line 63, in main
cloudflarespeedtest(command)
File "/opt/FastCDN/FastCDN.py", line 72, in cloudflarespeedtest
subprocess.run(command)
File "/usr/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/FastCDN/CloudflareST -f ./tmp/ipv4.txt -o ./tmp/result.csv -p 0 -httping -cfcolo HKG -n 200 -t 4 -dn 20 -dt 10 -tp 443 -url https://cf.xiu2.xyz/url -tl 300 -tll 20 -tlr 0.3 -sl 3'
找chatgpt告诉我:
根据输出结果显示,命令执行失败,因为系统无法找到名为 ./CloudflareST -f ./tmp/ipv4.txt -o ./tmp/result.csv -p 0 -httping -cfcolo HKG -n 200 -t 4 -dn 20 -dt 10 -tp 443 -url https://cf.xiu2.xyz/url -tl 300 -tll 20 -tlr 0.3 -sl 3 的文件或目录。这个问题可能是由于命令中包含了参数,导致系统将整个命令作为一个文件名来解释。
要解决这个问题,你应该将命令字符串分割成可执行的文件和参数,然后传递给 subprocess.run()。在你的代码中,应该这样修改 cloudflarespeedtest() 函数的调用部分:
python
Copy code
import shlex
将命令字符串分割成可执行文件和参数列表
command_parts = shlex.split(command)
subprocess.run(command_parts)
这样做可以确保正确解释命令字符串,使其可以被 subprocess.run() 正确执行。
The text was updated successfully, but these errors were encountered: