Coder Social home page Coder Social logo

yd072 / cloudflarest_auto_selector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snowfall9/cloudflarest_auto_selector

0.0 0.0 0.0 26 KB

简单的Cloudflare自动优选IP并添加DNS解析的工具,配合定时任务实现Windows平台上的自动优选第三方反代IP。Windows实现自动优选IP。

Python 100.00%

cloudflarest_auto_selector's Introduction

项目概述

项目名称: CloudflareSpeedTest_Auto_Selector

描述: 简单的自动优选第三方反代IP的工具,配合定时任务实现Windows平台上的自动优选第三方反代IP。该项目利用 XIU2 大佬的开源项目 CloudflareSpeedTest ,自动从一个第三方资源下载中转节点IP,筛选出活跃的IP,然后自动更新到Cloudflare的DNS记录。


前提条件:

安装:

  1. 克隆项目到本地。
  2. 使用pip安装所需的Python库: pip install requests
  3. 确保 CloudflareST.exe 在项目的根目录或在系统PATH中,请通过 CloudflareSpeedTest 下载合适的版本

使用教程

Cloudflare配置获取:

  1. 初次配置config.json 文件前,请在Cloudflare上创建一定数量的域名解析(10个以下),并将域名按行排列复制到 domains.txt 文件中,注意不要开启域名代理服务(小云朵)!
  2. config.json文件填写时,请在Cloudflare官网的 用户API 令牌 界面查看并复制自己的Global API Key 复制到global_api_key,在对应域名管理概述页面的右下角找到区域 ID复制到zone_idemail为你的Cloudflare账户邮箱。

开始使用:

  1. 确保所有依赖库和工具都已安装,确保 CloudflareST.exe 在项目的根目录或在系统PATH中。
  2. 确认config.json配置文件前三项 email global_api_key zone_id 已正确填写,且将已添加解析的域名按行排列复制到 domains.txt 文件。
  3. 在项目根目录下运行 python get_record_id.py 获取domains.txt 中所有域名对应的record id并自动添加到 config.json 配置文件中。
  4. cmd.txt 存放默认的 CloudflareST.exe 执行指令,可根据需求自行更改,指令文档 CloudflareSpeedTest ,需注意 -f 3ip.txt -p 0 指令为必须存在的指令,分别指向了IP文件与程序结束指令,其中-url 后面的参数可自行替换为自己常用的测速地址。
  5. 在项目根目录下运行 python cf_dns_updater.py
  6. 程序将自动下载中转节点、筛选IP、测速,并更新Cloudflare的DNS记录。
  7. 以上6步在第一次完成后,后续想进行自动优选只需要进行第5步即可。

第三方工具说明

该项目使用了 CloudflareST.exe,一个开源的Cloudflare CDN节点测速筛选工具。该工具提供了测速并将结果输出到CSV文件的功能,为本项目的DNS记录更新提供了支持。

使用链接: CloudflareSpeedTest

感谢大佬提供的第三方反代IP

第三方中转节点来源: https://zip.baipiao.eu.org


常见问题 (FAQ)

Q: 如何实现自动优选?

A: 配置好所有内容后打包 cf_dns_updater.py 为可执行文件,或者设置一个bat批处理文件执行python脚本,然后在Windows的任务计划程序中添加定时/开机运行任务,或者借助一些第三方定时运行程序的工具实现此目的。

Q: 程序执行时出现错误怎么办?

A: 请检查你的config.json是否已按照文档中的说明进行了正确配置。

Q: CloudflareST.exe程序应该怎么放置?

A: 放置在根目录即可,仅需要CloudflareST.exe 一个可执行文件即可。


更新日志

  • v1.0 - 初始版本,支持自动下载中转节点、筛选IP、测速并更新Cloudflare的DNS记录。

cloudflarest_auto_selector's People

Contributors

snowfall9 avatar

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.