akimio521 / fastcdn Goto Github PK
View Code? Open in Web Editor NEW全自动优选特定地区IP并自动解析到域名
License: GNU Affero General Public License v3.0
全自动优选特定地区IP并自动解析到域名
License: GNU Affero General Public License v3.0
Traceback (most recent call last):
File "/root/cdn/main.py", line 95, in
main()
File "/root/cdn/main.py", line 21, in main
email = config_data["setting"]["account"]["email"]
TypeError: 'NoneType' object is not subscriptable
执行 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() 正确执行。
在linux上应该先运行那个文件
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.