Giter Club home page Giter Club logo

fastcdn's People

Contributors

akimio521 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fastcdn's Issues

延迟测速可用数始终为0

因为yaml缩进问题比较恶心,我改为使用json。目前能跑通,tmp下ip文件也全部下载成功,但是存在一个问题是,延迟测速可用数始终为0。
屏幕截图 2024-03-04 123521

在linux服务器配置出现的问题

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

debian12无法运行

执行 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() 正确执行。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.