diff --git a/.github/workflows/run_autoddns.yml b/.github/workflows/run_autoddns.yml new file mode 100644 index 0000000..6b4e20b --- /dev/null +++ b/.github/workflows/run_autoddns.yml @@ -0,0 +1,39 @@ +name: Run autoddns + +on: + push: + branches: + - main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 + paths: + - 'cfip/ip.txt' # 只有 ipv6.txt 文件发生变化时才触发 + - 'csv/result.csv' + +jobs: + run-autoddns: + runs-on: ubuntu-latest + + env: + # 设置环境变量,使用 GitHub Secrets + CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} + CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run autoddns script + run: | + python ddns/autoddns.py \ No newline at end of file diff --git a/.github/workflows/run_autoddnsfd.yml b/.github/workflows/run_autoddnsfd.yml new file mode 100644 index 0000000..723d187 --- /dev/null +++ b/.github/workflows/run_autoddnsfd.yml @@ -0,0 +1,39 @@ +name: Run autoddnsfd + +on: + push: + branches: + - main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 + paths: + - 'cfip/fd.txt' # 只有 fd.txt 文件发生变化时才触发 + - 'csv/resultfd.csv' + +jobs: + run-autoddns: + runs-on: ubuntu-latest + + env: + # 设置环境变量,使用 GitHub Secrets + CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} + CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run autoddnsfd script + run: | + python ddns/autoddnsfd.py \ No newline at end of file diff --git a/.github/workflows/run_autoddnsv6.yml b/.github/workflows/run_autoddnsv6.yml new file mode 100644 index 0000000..63e150b --- /dev/null +++ b/.github/workflows/run_autoddnsv6.yml @@ -0,0 +1,39 @@ +name: Run autoddnsv6 + +on: + push: + branches: + - main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 + paths: + - 'cfip/ipv6.txt' # 只有 ipv6.txt 文件发生变化时才触发 + - 'csv/resultv6.csv' + +jobs: + run-autoddns: + runs-on: ubuntu-latest + + env: + # 设置环境变量,使用 GitHub Secrets + CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} + CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run autoddnsv6 script + run: | + python ddns/autoddnsv6.py \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e21fce7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# 忽略所有 .session 文件 +*.session + +# 忽略特定命名的 session 文件(例如 "my_session.session") +my_session.session + +# 忽略包含敏感信息的文件(如 API_ID 和 API_HASH) +config.ini +secrets.json +.env \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2272038 --- /dev/null +++ b/README.md @@ -0,0 +1,130 @@ +```markdown +# Cloudflare IP 优选与自动 DNS 更新工具集 + +一套用于从 Telegram 频道获取 Cloudflare IP 列表、测速优选、校验可用性并自动更新 Cloudflare DNS 记录的自动化工具集。 + +--- + +## 文件说明 + +### 1. 核心工具 +| 文件名 | 功能描述 | +|------------------|--------------------------------------------------------------------------| +| `tg.py` | 从指定 Telegram 频道下载 CSV 文件,解析并保存优选 IP 到 `cfip.txt`。 | +| `checker.py` | 校验 IP 的可用性(Ping/TCP),清理无效 IP 并记录日志。 | + +### 2. 测速工具(IPv4/IPv6) +| 文件名 | 功能描述 | +|------------------|--------------------------------------------------------------------------| +| `cfst.py` | 针对 IPv4 的 CloudflareSpeedTest 测速,筛选高速 IP 并生成结果文件。 | +| `cfstv6.py` | 针对 IPv6 的测速脚本,支持多端口和多区域测试。 | +| `cfstfd.py` | 特定场景下的测速脚本,用于生成 `fd.txt` 和 `fdport.txt`。 | + +### 3. DNS 自动更新 +| 文件名 | 功能描述 | +|------------------|--------------------------------------------------------------------------| +| `autoddns.py` | 读取 `ip.txt`,批量更新 IPv4 的 Cloudflare DNS A 记录。 | +| `autoddnsv6.py` | 读取 `ipv6.txt`,批量更新 IPv6 的 Cloudflare DNS AAAA 记录。 | +| `autoddnsfd.py` | 针对 `fd.txt` 的专用 DNS 更新脚本,支持多级域名映射。 | + +--- + +## 功能特性 + +- **自动化流程**:从 IP 获取、测速、校验到 DNS 更新全流程自动化。 +- **多区域支持**:支持 HKG、SJC、LAX、FRA 等全球多个 Cloudflare 数据中心。 +- **双栈支持**:IPv4 和 IPv6 双协议栈测速与 DNS 管理。 +- **日志与通知**:集成日志记录和 Telegram 通知功能。 +- **Git 集成**:自动提交结果到 GitHub 仓库。 + +--- + +## 依赖项 + +- **Python 3.8+** +- 必要库:`telethon`, `requests`, `socks`, `csv`, `logging` +- **外部工具**: + - [CloudflareSpeedTest](https://github.com/XIU2/CloudflareSpeedTest)(自动下载) + - Git(用于版本控制) + +--- + +## 配置与使用 + +### 1. 环境变量配置 +在 GitHub Secrets 或本地 `.env` 文件中设置以下变量: +```env +CLOUDFLARE_API_KEY="your_api_key" +CLOUDFLARE_EMAIL="your_email@example.com" +CLOUDFLARE_ZONE_ID="your_zone_id" +TELEGRAM_BOT_TOKEN="your_bot_token" +TELEGRAM_CHAT_ID="your_chat_id" +``` + +### 2. 脚本配置 +- **Telegram 配置**(`tg.py`): + ```python + API_ID = '' + API_HASH = '' + CHANNEL = '' # 目标频道 + ``` + +- **测速参数**(`cfst*.py`): + ```python + cfcolo_list = ["HKG", "SJC", "LAX", "FRA"] # 测速区域 + cf_ports = [443, 2053, 2083] # 测速端口 + ``` + +### 3. 运行流程 +1. **获取 IP 列表**: + ```bash + python tg.py + ``` + +2. **测速与筛选**: + ```bash + python cfst.py # IPv4 + python cfstv6.py # IPv6 + ``` + +3. **校验可用性**: + ```bash + python checker.py + ``` + +4. **更新 DNS**: + ```bash + python autoddns.py # IPv4 + python autoddnsv6.py # IPv6 + ``` + +--- + +## 目录结构 +``` +. +├── cfip/ # 存储 IP 列表文件(ip.txt、ipv6.txt 等) +├── csv/ # 测速生成的 CSV 结果 +├── log/ # 日志文件 +├── port/ # 含端口信息的 IP 列表 +├── speed/ # 高速 IP 结果 +├── tg.py +├── cfst*.py +├── autoddns*.py +└── checker.py +``` + +--- + +## 注意事项 + +1. **敏感信息保护**:切勿将 `API_KEY`、`TELEGRAM_BOT_TOKEN` 等写入公开代码。 +2. **测速频率**:建议通过 Cron 或 GitHub Actions 定时运行,避免频繁请求。 +3. **文件权限**:确保脚本有权限读写目录和文件(尤其是 Linux 环境)。 +4. **代理配置**:如需代理,在 `tg.py` 中设置 `PROXY_*` 参数。 + +--- + +## 许可证 +MIT License. 更多细节详见代码文件头部的声明。 +``` \ No newline at end of file diff --git a/__pycache__/checker.cpython-312.pyc b/__pycache__/checker.cpython-312.pyc new file mode 100644 index 0000000..1217576 Binary files /dev/null and b/__pycache__/checker.cpython-312.pyc differ diff --git a/__pycache__/colo_emojis.cpython-311.pyc b/__pycache__/colo_emojis.cpython-311.pyc new file mode 100644 index 0000000..2b12b19 Binary files /dev/null and b/__pycache__/colo_emojis.cpython-311.pyc differ diff --git a/__pycache__/colo_emojis.cpython-312.pyc b/__pycache__/colo_emojis.cpython-312.pyc new file mode 100644 index 0000000..eecd741 Binary files /dev/null and b/__pycache__/colo_emojis.cpython-312.pyc differ diff --git a/__pycache__/sk.cpython-311.pyc b/__pycache__/sk.cpython-311.pyc new file mode 100644 index 0000000..df7ccd6 Binary files /dev/null and b/__pycache__/sk.cpython-311.pyc differ diff --git a/__pycache__/sk.cpython-312.pyc b/__pycache__/sk.cpython-312.pyc new file mode 100644 index 0000000..a1fb5cc Binary files /dev/null and b/__pycache__/sk.cpython-312.pyc differ diff --git a/__pycache__/socket.cpython-311.pyc b/__pycache__/socket.cpython-311.pyc new file mode 100644 index 0000000..64e1b3a Binary files /dev/null and b/__pycache__/socket.cpython-311.pyc differ diff --git a/amd64/cfst b/amd64/cfst new file mode 100755 index 0000000..55b203f Binary files /dev/null and b/amd64/cfst differ diff --git a/arm64/cfst b/arm64/cfst new file mode 100755 index 0000000..5fd7b36 Binary files /dev/null and b/arm64/cfst differ diff --git a/armv7/cfst b/armv7/cfst new file mode 100755 index 0000000..cf9d300 Binary files /dev/null and b/armv7/cfst differ diff --git a/cfip/cfip.txt b/cfip/cfip.txt new file mode 100755 index 0000000..e5961d2 --- /dev/null +++ b/cfip/cfip.txt @@ -0,0 +1 @@ +47.90.141.204:443#🇺🇸LAX┃CF优选 \ No newline at end of file diff --git a/cfip/fd.txt b/cfip/fd.txt new file mode 100755 index 0000000..1774180 --- /dev/null +++ b/cfip/fd.txt @@ -0,0 +1,9 @@ +47.251.33.121#🇺🇸SJC +150.230.42.80#🇺🇸SJC +152.67.251.232#🇺🇸SJC +144.24.53.45#🇺🇸SJC +47.254.17.234#🇺🇸SJC +129.146.111.62#🇺🇸LAX +129.153.116.130#🇺🇸LAX +132.226.114.74#🇺🇸LAX +91.149.239.122#🇺🇸LAX diff --git a/cfst.py b/cfst.py new file mode 100644 index 0000000..9634686 --- /dev/null +++ b/cfst.py @@ -0,0 +1,247 @@ +import os +import subprocess +import csv +import sys +import random +import time +import logging +import platform +from colo_emojis import colo_emojis +from checker import process_ip_list + +# ------------------------------ +# 初始化设置 +# ------------------------------ + +# 配置日志 +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +# 获取当前脚本的路径 +script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) + +# 切换到当前脚本所在的目录 +os.chdir(script_dir) + +# 工具函数 +def remove_file(file_path): + """删除指定路径的文件""" + if os.path.exists(file_path): + os.remove(file_path) + logging.info(f"已删除 {file_path} 文件。") + +def create_directories(directories): + """创建所需的目录""" + for directory in directories: + os.makedirs(directory, exist_ok=True) + logging.info(f"已创建或确认目录 {directory} 存在。") + +def download_and_extract(url, target_path): + """下载并解压文件""" + downloaded_file = url.split("/")[-1] + logging.info(f"正在下载文件: {downloaded_file}") + subprocess.run(["wget", "-N", url], check=True) + + if downloaded_file.endswith(".tar.gz"): + try: + subprocess.run(["tar", "-zxf", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + elif downloaded_file.endswith(".zip"): + try: + subprocess.run(["unzip", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + else: + logging.error("无法识别的压缩文件格式!") + sys.exit(1) + + remove_file(downloaded_file) + subprocess.run(["mv", "CloudflareST", target_path], check=True) + subprocess.run(["chmod", "+x", target_path], check=True) + +def write_to_file(file_path, data, mode="a"): + """将数据写入文件""" + with open(file_path, mode=mode, encoding="utf-8") as file: + for item in data: + file.write(item + "\n") + logging.info(f"写入: {item}") + +def read_csv(file_path): + """读取CSV文件并返回数据""" + if os.path.getsize(file_path) == 0: + logging.warning(f"文件 {file_path} 为空,跳过读取。") + return None, None + + with open(file_path, mode="r", encoding="utf-8") as csvfile: + reader = csv.reader(csvfile) + try: + header = next(reader) # 读取表头 + except StopIteration: + logging.warning(f"文件 {file_path} 格式不正确或为空,跳过读取。") + return None, None + + if "下载速度 (MB/s)" not in header: + logging.error("无法找到下载速度列,请检查 CSV 文件表头。") + sys.exit(1) + + speed_index = header.index("下载速度 (MB/s)") + ip_addresses = [] + download_speeds = [] + + for row in reader: + ip_addresses.append(row[0]) + download_speeds.append(row[speed_index]) + if len(ip_addresses) >= 10: # 读取csv文件前十行 + break + + return ip_addresses, download_speeds + +def execute_git_pull(): + """执行 git pull 操作""" + try: + logging.info("正在执行 git pull...") + subprocess.run(["git", "pull"], check=True) + logging.info("git pull 成功,本地仓库已更新。") + except subprocess.CalledProcessError as e: + logging.error(f"git pull 失败: {e}") + sys.exit(1) + +def execute_cfst_test(cfst_path, cfcolo, result_file, random_port): + """执行 CloudflareSpeedTest 测试""" + logging.info(f"正在测试区域: {cfcolo}") + + # 执行 CloudflareSpeedTest 测试 + try: + subprocess.run( + [ + f"./{cfst_path}", + "-f", "ip.txt", + "-o", result_file, + "-httping", + "-cfcolo", cfcolo, + "-tl", "300", + "-tll", "10", + "-tp", str(random_port), + "-dn", "10", + "-p", "10" + ], + check=True + ) + except subprocess.CalledProcessError as e: + logging.error(f"CloudflareSpeedTest 测试失败: {e}") + sys.exit(1) + + # 检查是否生成了 result_file 文件 + if not os.path.exists(result_file): + logging.warning(f"未生成 {result_file} 文件,正在新建一个空的 {result_file} 文件。") + with open(result_file, "w") as file: + file.write("") # 创建一个空文件 + logging.info(f"已新建 {result_file} 文件。") + else: + logging.info(f"{result_file} 文件已存在,无需新建。") + +def process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port): + """处理测试结果并写入文件""" + ip_addresses, download_speeds = read_csv(result_file) + + if not ip_addresses: + return # 跳过当前循环 + + logging.info(f"区域 {cfcolo} 提取到的 IP 地址数量: {len(ip_addresses)}") + + # 将 IP 地址和 colo 信息写入 ip.txt + write_to_file(output_txt, [f"{ip}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}" for ip in ip_addresses]) + logging.info(f"提取的 IP 地址和 colo 信息已保存到 {output_txt}") + + # 将 IP 地址、端口、colo 信息和下载速度写入 ipport.txt + write_to_file(port_txt, [f"{ip}:{random_port}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}┃CF优选┃⚡{speed}(MB/s)" for ip, speed in zip(ip_addresses, download_speeds)]) + logging.info(f"IP 地址、端口、colo 信息和下载速度已追加到 {port_txt}") + + # 筛选下载速度大于 10 MB/s 的 IP,并追加写入 output_cf_txt + fast_ips = [f"{ip}:{random_port}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}┃CF优选┃⚡{speed}(MB/s)" for ip, speed in zip(ip_addresses, download_speeds) if float(speed) > 10] + if fast_ips: # 如果有下载速度大于 10 MB/s 的 IP + write_to_file(output_cf_txt, fast_ips) + logging.info(f"筛选下载速度大于 10 MB/s 的 IP 已追加到 {output_cf_txt}") + else: + logging.info(f"区域 {cfcolo} 未找到下载速度大于 10 MB/s 的 IP,跳过写入操作。") + + # 清空 result.csv 文件 + open(result_file, "w").close() + logging.info(f"已清空 {result_file} 文件。") + +def git_commit_and_push(commit_message): + """执行 git commit 和 push 操作""" + try: + subprocess.run(["git", "add", "."], check=True) + subprocess.run(["git", "commit", "-m", commit_message], check=True) + subprocess.run(["git", "push", "-u", "origin", "main"], check=True) + logging.info("已将文件上传到 GitHub 仓库。") + except subprocess.CalledProcessError as e: + logging.error(f"Git 操作失败: {e}") + sys.exit(1) + +# 在脚本执行前删除文件 +files_to_remove = ["cfip/ip.txt", "log/iplog.txt", "port/ipport.txt", "log/iplog2.txt"] +for file_path in files_to_remove: + remove_file(file_path) + +# 创建所需的目录 +directories_to_create = ["csv", "log", "port", "cfip", "speed"] +create_directories(directories_to_create) + +# 定义文件路径和变量 +result_file = "csv/result.csv" +cfip_file = "cfip/ip.txt" +output_txt = "cfip/ip.txt" +port_txt = "port/ipport.txt" +log_file = "log/iplog.txt" +output_cf_txt = "speed/ip.txt" +iplog_file = "log/iplog2.txt" +commit_message = "Update result.csv and ip.txt" + +# 根据系统架构选择下载链接和 cfst 路径 +system_arch = platform.machine().lower() + +if system_arch in ["x86_64", "amd64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_amd64.tar.gz" + cfst_path = "amd64/cfst" +elif system_arch in ["aarch64", "arm64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_arm64.tar.gz" + cfst_path = "arm64/cfst" +elif system_arch in ["armv7l", "armv6l"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_armv7.tar.gz" + cfst_path = "armv7/cfst" +else: + logging.error(f"不支持的架构: {system_arch}") + sys.exit(1) + +logging.info(f"检测到系统架构为 {system_arch},将下载对应的 CloudflareST 版本: {download_url}") + +# 在执行主程序逻辑之前,先执行 git pull +execute_git_pull() + +# 检查 cfst 文件是否存在 +if not os.path.exists(cfst_path): + download_and_extract(download_url, cfst_path) + +# 定义 cfcolo 数组(目标区域) +cfcolo_list = ["HKG", "SJC", "SEA", "LAX", "FRA", "SIN"] + +# Cloudflare 支持的标准端口列表 +cf_ports = [443, 2053, 2083, 2087, 2096, 8443] + +# 遍历 cfcolo_list 并依次执行测试 +for cfcolo in cfcolo_list: + random_port = random.choice(cf_ports) + execute_cfst_test(cfst_path, cfcolo, result_file, random_port) + process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port) + +# 删除不可达的 IP +process_ip_list(output_cf_txt,iplog_file) + +# Git 上传步骤 +git_commit_and_push(commit_message) \ No newline at end of file diff --git a/cfst_hosts.sh b/cfst_hosts.sh new file mode 100755 index 0000000..117ce01 --- /dev/null +++ b/cfst_hosts.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +# -------------------------------------------------------------- +# 项目: CloudflareSpeedTest 自动更新 Hosts +# 版本: 1.0.4 +# 作者: XIU2 +# 项目: https://github.com/XIU2/CloudflareSpeedTest +# -------------------------------------------------------------- + +_CHECK() { + while true + do + if [[ ! -e "nowip_hosts.txt" ]]; then + echo -e "该脚本的作用为 CloudflareST 测速后获取最快 IP 并替换 Hosts 中的 Cloudflare CDN IP。\n使用前请先阅读:https://github.com/XIU2/CloudflareSpeedTest/issues/42#issuecomment-768273848" + echo -e "第一次使用,请先将 Hosts 中所有 Cloudflare CDN IP 统一改为一个 IP。" + read -e -p "输入该 Cloudflare CDN IP 并回车(后续不再需要该步骤):" NOWIP + if [[ ! -z "${NOWIP}" ]]; then + echo ${NOWIP} > nowip_hosts.txt + break + else + echo "该 IP 不能是空!" + fi + else + break + fi + done +} + +_UPDATE() { + echo -e "开始测速..." + NOWIP=$(head -1 nowip_hosts.txt) + + # 这里可以自己添加、修改 CloudflareST 的运行参数 + ./CloudflareST -o "result_hosts.txt" + + # 如果需要 "找不到满足条件的 IP 就一直循环测速下去",那么可以将下面的两个 exit 0 改为 _UPDATE 即可 + [[ ! -e "result_hosts.txt" ]] && echo "CloudflareST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0 + + # 下面这行代码是 "找不到满足条件的 IP 就一直循环测速下去" 才需要的代码 + # 考虑到当指定了下载速度下限,但一个满足全部条件的 IP 都没找到时,CloudflareST 就会输出所有 IP 结果 + # 因此当你指定 -sl 参数时,需要移除下面这段代码开头的 # 井号注释符,来做文件行数判断(比如下载测速数量:10 个,那么下面的值就设在为 11) + #[[ $(cat result_hosts.txt|wc -l) > 11 ]] && echo "CloudflareST 测速结果没有找到一个完全满足条件的 IP,重新测速..." && _UPDATE + + + BESTIP=$(sed -n "2,1p" result_hosts.txt | awk -F, '{print $1}') + if [[ -z "${BESTIP}" ]]; then + echo "CloudflareST 测速结果 IP 数量为 0,跳过下面步骤..." + exit 0 + fi + echo ${BESTIP} > nowip_hosts.txt + echo -e "\n旧 IP 为 ${NOWIP}\n新 IP 为 ${BESTIP}\n" + + echo "开始备份 Hosts 文件(hosts_backup)..." + \cp -f /etc/hosts /etc/hosts_backup + + echo -e "开始替换..." + sed -i 's/'${NOWIP}'/'${BESTIP}'/g' /etc/hosts + echo -e "完成..." +} + +_CHECK +_UPDATE \ No newline at end of file diff --git a/cfstfd.py b/cfstfd.py new file mode 100644 index 0000000..77f74fd --- /dev/null +++ b/cfstfd.py @@ -0,0 +1,293 @@ +import os +import subprocess +import csv +import sys +import requests +import random +import logging +import platform +from colo_emojis import colo_emojis +from checker import process_ip_list + +# ------------------------------ +# 初始化设置 +# ------------------------------ + +# 配置日志 +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=[ + logging.FileHandler("log/fdlog.txt"), # 日志写入文件 + logging.StreamHandler(sys.stdout) # 日志输出到控制台 + ] +) +logging = logging.getLogger(__name__) + +def install_package(package_name): + """检查并安装指定的Python包""" + try: + __import__(package_name) + logging.info(f"{package_name} 已安装") + except ImportError: + logging.info(f"{package_name} 未安装,正在安装...") + try: + subprocess.check_call([sys.executable, "-m", "pip", "install", package_name]) + logging.info(f"{package_name} 安装成功") + except subprocess.CalledProcessError as e: + logging.error(f"安装 {package_name} 失败: {e}") + sys.exit(1) + +# 检查并安装所需的库 +required_packages = ["requests", "csv"] +for package in required_packages: + install_package(package) + +# 获取当前脚本的路径 +script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) + +# 切换到当前脚本所在的目录 +os.chdir(script_dir) + +# 工具函数 +def remove_file(file_path): + """删除指定路径的文件""" + if os.path.exists(file_path): + os.remove(file_path) + logging.info(f"已删除 {file_path} 文件。") + +def create_directories(directories): + """创建所需的目录""" + for directory in directories: + os.makedirs(directory, exist_ok=True) + logging.info(f"已创建或确认目录 {directory} 存在。") + +def download_file(url, file_path): + """从指定 URL 下载文件""" + try: + logging.info(f"正在从 {url} 下载文件...") + response = requests.get(url, timeout=10) + if response.status_code == 200: + with open(file_path, "wb") as file: + file.write(response.content) + logging.info(f"已成功下载 {file_path} 文件。") + else: + logging.error(f"下载 {file_path} 文件失败,状态码: {response.status_code}") + sys.exit(1) + except requests.exceptions.RequestException as e: + logging.error(f"下载 {file_path} 文件时发生错误: {e}") + sys.exit(1) + +def execute_git_pull(): + """执行 git pull 操作""" + try: + logging.info("正在执行 git pull...") + subprocess.run(["git", "pull"], check=True) + logging.info("git pull 成功,本地仓库已更新。") + except subprocess.CalledProcessError as e: + logging.error(f"git pull 失败: {e}") + sys.exit(1) + +def download_and_extract(url, target_path): + """下载并解压文件""" + downloaded_file = url.split("/")[-1] + logging.info(f"正在下载文件: {downloaded_file}") + subprocess.run(["wget", "-N", url], check=True) + + if downloaded_file.endswith(".tar.gz"): + try: + subprocess.run(["tar", "-zxf", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + elif downloaded_file.endswith(".zip"): + try: + subprocess.run(["unzip", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + else: + logging.error("无法识别的压缩文件格式!") + sys.exit(1) + + remove_file(downloaded_file) + subprocess.run(["mv", "CloudflareST", target_path], check=True) + subprocess.run(["chmod", "+x", target_path], check=True) + +def write_to_file(file_path, data, mode="a"): + """将数据写入文件""" + with open(file_path, mode=mode, encoding="utf-8") as file: + for item in data: + file.write(item + "\n") + logging.info(f"写入: {item}") + +def read_csv(file_path): + """读取CSV文件并返回数据""" + if os.path.getsize(file_path) == 0: + logging.warning(f"文件 {file_path} 为空,跳过读取。") + return None, None + + with open(file_path, mode="r", encoding="utf-8") as csvfile: + reader = csv.reader(csvfile) + try: + header = next(reader) # 读取表头 + except StopIteration: + logging.warning(f"文件 {file_path} 格式不正确或为空,跳过读取。") + return None, None + + if "下载速度 (MB/s)" not in header: + logging.error("无法找到下载速度列,请检查 CSV 文件表头。") + sys.exit(1) + + speed_index = header.index("下载速度 (MB/s)") + ip_addresses = [] + download_speeds = [] + + for row in reader: + ip_addresses.append(row[0]) + download_speeds.append(row[speed_index]) + if len(ip_addresses) >= 10: # 读取csv文件前十行 + break + + return ip_addresses, download_speeds + +def execute_cfst_test(cfst_path, cfcolo, result_file, random_port): + """执行 CloudflareSpeedTest 测试""" + logging.info(f"正在测试区域: {cfcolo}") + + # 执行 CloudflareSpeedTest 测试 + try: + subprocess.run( + [ + f"./{cfst_path}", + "-f", "proxy.txt", + "-o", result_file, + "-httping", + "-cfcolo", cfcolo, + "-tl", "300", + "-tll", "10", + "-tp", str(random_port), + "-dn", "10", + "-p", "10" + ], + check=True + ) + except subprocess.CalledProcessError as e: + logging.error(f"CloudflareSpeedTest 测试失败: {e}") + sys.exit(1) + + # 检查是否生成了 result_file 文件 + if not os.path.exists(result_file): + logging.warning(f"未生成 {result_file} 文件,正在新建一个空的 {result_file} 文件。") + with open(result_file, "w") as file: + file.write("") # 创建一个空文件 + logging.info(f"已新建 {result_file} 文件。") + else: + logging.info(f"{result_file} 文件已存在,无需新建。") + +def process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port): + """处理测试结果并写入文件""" + ip_addresses, download_speeds = read_csv(result_file) + + if not ip_addresses: + return # 跳过当前循环 + + logging.info(f"区域 {cfcolo} 提取到的 IP 地址数量: {len(ip_addresses)}") + + # 将 IP 地址和 colo 信息写入 fd.txt + write_to_file(output_txt, [f"{ip}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}" for ip in ip_addresses]) + logging.info(f"提取的 IP 地址和 colo 信息已保存到 {output_txt}") + + # 将 IP 地址、端口、colo 信息和下载速度写入 fdport.txt + write_to_file(port_txt, [f"{ip}:{random_port}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}┃⚡{speed}(MB/s)" for ip, speed in zip(ip_addresses, download_speeds)]) + logging.info(f"IP 地址、端口、colo 信息和下载速度已追加到 {port_txt}") + + # 清空 result.csv 文件 + open(result_file, "w").close() + logging.info(f"已清空 {result_file} 文件。") + +def git_commit_and_push(commit_message): + """执行 git commit 和 push 操作""" + try: + subprocess.run(["git", "add", "."], check=True) + subprocess.run(["git", "commit", "-m", commit_message], check=True) + subprocess.run(["git", "push", "-u", "origin", "main"], check=True) + logging.info("已将文件上传到 GitHub 仓库。") + except subprocess.CalledProcessError as e: + logging.error(f"Git 操作失败: {e}") + sys.exit(1) + +# 在脚本执行前删除文件 +files_to_remove = ["cfip/fd.txt", "log/fdlog.txt", "port/fdport.txt"] +for file_path in files_to_remove: + remove_file(file_path) + +# 创建所需的目录 +directories_to_create = ["csv", "log", "port", "cfip", "speed"] +create_directories(directories_to_create) + +# 定义文件路径和变量 +cfst_path = "cfst" +result_file = "csv/resultfd.csv" +cfip_file = "cfip/fd.txt" +output_txt = "cfip/fd.txt" +port_txt = "port/fdport.txt" +log_file = "log/fdlog.txt" +output_cf_txt = "speed/fd.txt" +proxy = "proxy.txt" +proxy_txt = "cfip/proxy.txt" +iplog_file = "log/fdlog2.txt" +commit_message = "Update result.csv and fd.txt" + +# 定义 cfcolo 数组(目标区域) +cfcolo_list = ["HKG", "SJC", "SEA", "LAX", "FRA", "NRT", "SIN"] + +# Cloudflare 支持的标准端口列表 +cf_ports = [443] + +# 获取系统架构 +system_arch = platform.machine().lower() + +# 根据系统架构选择对应的下载链接 +if system_arch in ["x86_64", "amd64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_amd64.tar.gz" + cfst_path = "amd64/cfst" +elif system_arch in ["aarch64", "arm64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_arm64.tar.gz" + cfst_path = "arm64/cfst" +elif system_arch in ["armv7l", "armv6l"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_armv7.tar.gz" + cfst_path = "armv7/cfst" +else: + logging.error(f"不支持的架构: {system_arch}") + sys.exit(1) + +logging.info(f"检测到系统架构为 {system_arch},将下载对应的 CloudflareST 版本: {download_url}") + +# 删除 proxy.txt 文件(如果存在) +remove_file(proxy) + +# 从指定 URL 下载 proxy.txt 文件 +proxy_url = "https://ipdb.api.030101.xyz/?type=proxy&down=true" +download_file(proxy_url, proxy) + +# 在执行主程序逻辑之前,先执行 git pull +execute_git_pull() + +# 检查 cfst 文件是否存在 +if not os.path.exists(cfst_path): + download_and_extract(download_url, cfst_path) + +# 遍历 cfcolo_list 并依次执行测试 +for cfcolo in cfcolo_list: + random_port = random.choice(cf_ports) + execute_cfst_test(cfst_path, cfcolo, result_file, random_port) + process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port) + +# 删除不可达的 IP +process_ip_list(cfip_file,iplog_file) + +# Git 上传步骤 +git_commit_and_push(commit_message) \ No newline at end of file diff --git a/cfstv6.py b/cfstv6.py new file mode 100644 index 0000000..723e468 --- /dev/null +++ b/cfstv6.py @@ -0,0 +1,246 @@ +import os +import subprocess +import csv +import sys +import random +import logging +import platform +from colo_emojis import colo_emojis +from checker import process_ip_list + +# ------------------------------ +# 初始化设置 +# ------------------------------ + +# 配置日志 +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +# 获取当前脚本的路径 +script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) + +# 切换到当前脚本所在的目录 +os.chdir(script_dir) + +# 工具函数 +def remove_file(file_path): + """删除指定路径的文件""" + if os.path.exists(file_path): + os.remove(file_path) + logging.info(f"已删除 {file_path} 文件。") + +def create_directories(directories): + """创建所需的目录""" + for directory in directories: + os.makedirs(directory, exist_ok=True) + logging.info(f"已创建或确认目录 {directory} 存在。") + +def download_and_extract(url, target_path): + """下载并解压文件""" + downloaded_file = url.split("/")[-1] + logging.info(f"正在下载文件: {downloaded_file}") + subprocess.run(["wget", "-N", url], check=True) + + if downloaded_file.endswith(".tar.gz"): + try: + subprocess.run(["tar", "-zxf", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + elif downloaded_file.endswith(".zip"): + try: + subprocess.run(["unzip", downloaded_file], check=True) + logging.info(f"已成功解压: {downloaded_file}") + except subprocess.CalledProcessError as e: + logging.error(f"解压失败: {e}") + sys.exit(1) + else: + logging.error("无法识别的压缩文件格式!") + sys.exit(1) + + remove_file(downloaded_file) + subprocess.run(["mv", "CloudflareST", target_path], check=True) + subprocess.run(["chmod", "+x", target_path], check=True) + +def write_to_file(file_path, data, mode="a"): + """将数据写入文件""" + with open(file_path, mode=mode, encoding="utf-8") as file: + for item in data: + file.write(item + "\n") + logging.info(f"写入: {item}") + +def read_csv(file_path): + """读取CSV文件并返回数据""" + if os.path.getsize(file_path) == 0: + logging.warning(f"文件 {file_path} 为空,跳过读取。") + return None, None + + with open(file_path, mode="r", encoding="utf-8") as csvfile: + reader = csv.reader(csvfile) + try: + header = next(reader) # 读取表头 + except StopIteration: + logging.warning(f"文件 {file_path} 格式不正确或为空,跳过读取。") + return None, None + + if "下载速度 (MB/s)" not in header: + logging.error("无法找到下载速度列,请检查 CSV 文件表头。") + sys.exit(1) + + speed_index = header.index("下载速度 (MB/s)") + ip_addresses = [] + download_speeds = [] + + for row in reader: + ip_addresses.append(row[0]) + download_speeds.append(row[speed_index]) + if len(ip_addresses) >= 10: # 读取csv文件前十行 + break + + return ip_addresses, download_speeds + +def execute_git_pull(): + """执行 git pull 操作""" + try: + logging.info("正在执行 git pull...") + subprocess.run(["git", "pull"], check=True) + logging.info("git pull 成功,本地仓库已更新。") + except subprocess.CalledProcessError as e: + logging.error(f"git pull 失败: {e}") + sys.exit(1) + +def execute_cfst_test(cfst_path, cfcolo, result_file, random_port): + """执行 CloudflareSpeedTest 测试""" + logging.info(f"正在测试区域: {cfcolo}") + + # 执行 CloudflareSpeedTest 测试 + try: + subprocess.run( + [ + f"./{cfst_path}", + "-f", "ipv6.txt", + "-o", result_file, + "-httping", + "-cfcolo", cfcolo, + "-tl", "200", + "-tll", "10", + "-tp", str(random_port), + "-dn", "10", + "-p", "10" + ], + check=True + ) + except subprocess.CalledProcessError as e: + logging.error(f"CloudflareSpeedTest 测试失败: {e}") + sys.exit(1) + + # 检查是否生成了 result_file 文件 + if not os.path.exists(result_file): + logging.warning(f"未生成 {result_file} 文件,正在新建一个空的 {result_file} 文件。") + with open(result_file, "w") as file: + file.write("") # 创建一个空文件 + logging.info(f"已新建 {result_file} 文件。") + else: + logging.info(f"{result_file} 文件已存在,无需新建。") + +def process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port): + """处理测试结果并写入文件""" + ip_addresses, download_speeds = read_csv(result_file) + + if not ip_addresses: + return # 跳过当前循环 + + logging.info(f"区域 {cfcolo} 提取到的 IP 地址数量: {len(ip_addresses)}") + + # 将 IP 地址和 colo 信息写入 ipv6.txt + write_to_file(output_txt, [f"{ip}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}" for ip in ip_addresses]) + logging.info(f"提取的 IP 地址和 colo 信息已保存到 {output_txt}") + + # 将 IP 地址、端口、colo 信息和下载速度写入 ipv6port.txt + write_to_file(port_txt, [f"{ip}:{random_port}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}┃CF优选┃IPV6┃⚡{speed}(MB/s)" for ip, speed in zip(ip_addresses, download_speeds)]) + logging.info(f"IP 地址、端口、colo 信息和下载速度已追加到 {port_txt}") + + # 筛选下载速度大于 10 MB/s 的 IP,并追加写入 output_cf_txt + fast_ips = [f"{ip}:{random_port}#{colo_emojis.get(cfcolo, '☁️')}{cfcolo}┃CF优选┃IPV6┃⚡{speed}(MB/s)" for ip, speed in zip(ip_addresses, download_speeds) if float(speed) > 10] + if fast_ips: # 如果有下载速度大于 10 MB/s 的 IP + write_to_file(output_cf_txt, fast_ips) + logging.info(f"筛选下载速度大于 10 MB/s 的 IP 已追加到 {output_cf_txt}") + else: + logging.info(f"区域 {cfcolo} 未找到下载速度大于 10 MB/s 的 IP,跳过写入操作。") + + # 清空 result.csv 文件 + open(result_file, "w").close() + logging.info(f"已清空 {result_file} 文件。") + +def git_commit_and_push(commit_message): + """执行 git commit 和 push 操作""" + try: + subprocess.run(["git", "add", "."], check=True) + subprocess.run(["git", "commit", "-m", commit_message], check=True) + subprocess.run(["git", "push", "-u", "origin", "main"], check=True) + logging.info("已将文件上传到 GitHub 仓库。") + except subprocess.CalledProcessError as e: + logging.error(f"Git 操作失败: {e}") + sys.exit(1) + +# 在脚本执行前删除文件 +files_to_remove = ["cfip/ipv6.txt", "log/ipv6log.txt", "port/ipv6port.txt", "log/ipv6log2.txt"] +for file_path in files_to_remove: + remove_file(file_path) + +# 创建所需的目录 +directories_to_create = ["csv", "log", "port", "cfip", "speed"] +create_directories(directories_to_create) + +# 定义文件路径和变量 +result_file = "csv/resultv6.csv" +cfip_file = "cfip/ipv6.txt" +output_txt = "cfip/ipv6.txt" +port_txt = "port/ipv6port.txt" +log_file = "log/ipv6log.txt" +output_cf_txt = "speed/ipv6.txt" +iplog_file = "log/ipv6log2.txt" +commit_message = "Update resultv6.csv and ipv6.txt" + +# 根据系统架构选择下载链接和 cfst 路径 +system_arch = platform.machine().lower() + +if system_arch in ["x86_64", "amd64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_amd64.tar.gz" + cfst_path = "amd64/cfst" +elif system_arch in ["aarch64", "arm64"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_arm64.tar.gz" + cfst_path = "arm64/cfst" +elif system_arch in ["armv7l", "armv6l"]: + download_url = "https://github.com/XIU2/CloudflareSpeedTest/releases/download/v2.2.5/CloudflareST_linux_armv7.tar.gz" + cfst_path = "armv7/cfst" +else: + logging.error(f"不支持的架构: {system_arch}") + sys.exit(1) + +logging.info(f"检测到系统架构为 {system_arch},将下载对应的 CloudflareST 版本: {download_url}") + +# 在执行主程序逻辑之前,先执行 git pull +execute_git_pull() + +# 检查 cfst 文件是否存在 +if not os.path.exists(cfst_path): + download_and_extract(download_url, cfst_path) + +# 定义 cfcolo 数组(目标区域) +cfcolo_list = ["HKG", "SJC", "SEA", "LAX", "FRA", "SIN"] + +# Cloudflare 支持的标准端口列表 +cf_ports = [443, 2053, 2083, 2087, 2096, 8443] + +# 遍历 cfcolo_list 并依次执行测试 +for cfcolo in cfcolo_list: + random_port = random.choice(cf_ports) + execute_cfst_test(cfst_path, cfcolo, result_file, random_port) + process_test_results(cfcolo, result_file, output_txt, port_txt, output_cf_txt, random_port) + +# 删除不可达的 IP +process_ip_list(output_cf_txt,iplog_file) + +# Git 上传步骤 +git_commit_and_push(commit_message) \ No newline at end of file diff --git a/checker.py b/checker.py new file mode 100644 index 0000000..30b22c5 --- /dev/null +++ b/checker.py @@ -0,0 +1,147 @@ +import os +import socket +import subprocess +import time +import logging +import re + +# 设置日志 +def setup_logger(log_file): + """配置日志记录器""" + logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=[ + logging.StreamHandler(), + logging.FileHandler(log_file, mode="a") + ] + ) + return logging.getLogger() + +def is_ipv4(ip): + """检测是否是 IPv4 地址""" + return re.match(r"^\d{1,3}(\.\d{1,3}){3}$", ip) is not None + +def is_ipv6(ip): + """检测是否是 IPv6 地址""" + return re.match(r"^[0-9a-fA-F:]+$", ip) is not None + +def extract_ip_port(line): + """解析 IP 和端口(IPv6 先去掉 [],IPv4 直接解析)""" + line = line.split('#')[0].strip() # 去掉注释 + if not line: + return None, None + + # 解析 IPv6(带 []),格式如 [IPv6]:端口 + ipv6_match = re.match(r"^\[([0-9a-fA-F:]+)\](?::(\d+))?$", line) + if ipv6_match: + ip = ipv6_match.group(1) + port = ipv6_match.group(2) + port = int(port) if port else 443 # 默认端口 443 + return ip, port + + # 解析 IPv4,格式如 IPv4:端口 + ipv4_match = re.match(r"^([0-9.]+)(?::(\d+))?$", line) + if ipv4_match: + ip = ipv4_match.group(1) + port = ipv4_match.group(2) + port = int(port) if port else 443 + return ip, port + + return None, None + +def load_ips_from_file(filename): + """从文件中读取 IP 和端口""" + if not os.path.exists(filename): + logger.error(f"文件 {filename} 不存在") + return [] + + ips = [] + with open(filename, "r") as file: + for line in file: + ip, port = extract_ip_port(line) + if ip: + ips.append((ip, port)) + else: + logger.warning(f"无法解析的 IP: {line.strip()}") + + logger.info(f"加载 {len(ips)} 个 IP 地址") + return ips + +def ping_ip(ip, retries=3): + """使用 Ping 检测 IP 是否可达""" + ip_type = 'ipv4' if is_ipv4(ip) else 'ipv6' + cmd = ["ping", "-c", "1", ip] if ip_type == 'ipv4' else ["ping", "-6", "-c", "1", ip] + + for attempt in range(1, retries + 1): + try: + output = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + if "ttl=" in output.stdout.lower(): + return True + logger.warning(f"IP {ip} 第 {attempt} 次 Ping 失败") + except Exception as e: + logger.warning(f"IP {ip} Ping 失败: {str(e)}") + time.sleep(1) + + return False + +def tcp_check(ip, port=443, timeout=3, retries=3): + """使用 TCP 端口检测目标是否可达""" + for attempt in range(1, retries + 1): + try: + family = socket.AF_INET6 if is_ipv6(ip) else socket.AF_INET + with socket.socket(family, socket.SOCK_STREAM) as sock: + sock.settimeout(timeout) + sock.connect((ip, port)) + return True + except (socket.timeout, ConnectionRefusedError): + logger.warning(f"IP {ip} 端口 {port} 第 {attempt} 次 TCP 检测失败") + except Exception as e: + logger.warning(f"IP {ip} TCP 检测错误: {str(e)}") + time.sleep(1) + + return False + +def remove_ip_from_file(filename, ip): + """从文件中删除指定的 IP 行""" + with open(filename, "r") as file: + lines = file.readlines() + + new_lines = [line for line in lines if not line.startswith(f"[{ip}]") and not line.startswith(ip)] + if len(new_lines) != len(lines): + with open(filename, "w") as file: + file.writelines(new_lines) + logger.info(f"IP {ip} 已从文件中删除") + +def process_ip_list(input_file, log_file): + """处理 IP 列表""" + global logger + logger = setup_logger(log_file) # 初始化日志记录器 + + ip_list = load_ips_from_file(input_file) + + if not ip_list: + logger.warning("没有找到可用的 IP 地址") + return + + for ip, port in ip_list: + logger.info(f"检测 IP: {ip}:{port}") + + if not ping_ip(ip): + logger.warning(f"IP {ip} Ping 不可达,删除") + remove_ip_from_file(input_file, ip) + continue + + if not tcp_check(ip, port): + logger.warning(f"IP {ip} 端口 {port} 不可达,删除") + remove_ip_from_file(input_file, ip) + + time.sleep(1) + +def main(): + input_file = "cfip/fd.txt" # 输入文件路径 + log_file = "log/fdlog.txt" # 日志文件路径 + process_ip_list(input_file, log_file) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/colo_emojis.py b/colo_emojis.py new file mode 100644 index 0000000..77db56a --- /dev/null +++ b/colo_emojis.py @@ -0,0 +1,51 @@ +# colo_emojis.py +colo_emojis = { + "US": "🇺🇸", + "SJC": "🇺🇸", # 圣何塞 + "LAX": "🇺🇸", # 洛杉矶 + "SEA": "🇺🇸", # 西雅图 + "JFK": "🇺🇸", # 纽约 - 肯尼迪国际机场 + "ORD": "🇺🇸", # 芝加哥 - 奥黑尔国际机场 + "US": "🇺🇸", # 美国 + + # 德国 + "FRA": "🇩🇪", # 法兰克福机场 + "DE": "🇩🇪", # 德国 + + # 英国 + "LHR": "🇬🇧", # 伦敦 + "UK": "🇬🇧", # 英国 + + # 日本 + "NRT": "🇯🇵", # 东京成田 + "HND": "🇯🇵", # 东京羽田 + "JP": "🇯🇵", # 日本 + + # 香港 + "HKG": "🇭🇰", # 香港国际机场 + "HK": "🇭🇰", # 香港 + + # 韩国 + "ICN": "🇰🇷", # 仁川国际机场 + "KR": "🇰🇷", # 韩国 + + # 台湾 + "TPE": "🇹🇼", # 台北桃园机场 + "KHH": "🇹🇼", # 台湾高雄 + "TW": "🇹🇼", # 台湾 + + # 新加坡 + "SIN": "🇸🇬", # 樟宜机场 + "SG": "🇸🇬", # 新加坡 + + # 芬兰 + "HEL": "🇫🇮", # 赫尔辛基 + "FI": "🇫🇮", # 芬兰 + + # 波兰 + "WAW": "🇵🇱", # 华沙 + "PL": "🇵🇱", # 波兰 + + # CF优选 + "CF优选": "☁️" # CF优选 +} \ No newline at end of file diff --git a/csv/45102-20250131-IP.csv b/csv/45102-20250131-IP.csv new file mode 100644 index 0000000..35b3bf7 --- /dev/null +++ b/csv/45102-20250131-IP.csv @@ -0,0 +1,6 @@ +IP地址,端口,TLS,数据中心,地区,城市,网络延迟,下载速度 +47.90.141.204,443,true,LAX,North America,Los Angeles,237 ms,979 kB/s +47.57.13.107,443,true,HKG,Asia Pacific,Hong Kong,71 ms,14 kB/s +47.76.218.163,443,true,HKG,Asia Pacific,Hong Kong,61 ms,0 kB/s +47.236.181.185,8443,true,SIN,Asia Pacific,Singapore,217 ms,0 kB/s +47.57.14.118,443,true,SJC,North America,San Jose,72 ms,0 kB/s diff --git a/csv/result.csv b/csv/result.csv new file mode 100644 index 0000000..e69de29 diff --git a/csv/resultfd.csv b/csv/resultfd.csv new file mode 100644 index 0000000..e69de29 diff --git a/csv/resultv6.csv b/csv/resultv6.csv new file mode 100644 index 0000000..e69de29 diff --git a/ddns/autoddns.py b/ddns/autoddns.py new file mode 100644 index 0000000..612554a --- /dev/null +++ b/ddns/autoddns.py @@ -0,0 +1,212 @@ +import os +import requests +import logging +import sys + +# 配置日志 +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=[ + logging.FileHandler("dns_update.log"), + logging.StreamHandler() + ] +) + +# 从环境变量获取 Cloudflare API 配置信息 +API_KEY = os.getenv("CLOUDFLARE_API_KEY") +EMAIL = os.getenv("CLOUDFLARE_EMAIL") +ZONE_ID = os.getenv("CLOUDFLARE_ZONE_ID") +TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") +TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID") + +# 确保从环境变量中获取到了这些信息 +if not all([API_KEY, EMAIL, ZONE_ID, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID]): + logging.error("缺少必要的配置信息,请确保在 GitHub Secrets 中设置了 CLOUDFLARE_API_KEY, CLOUDFLARE_EMAIL, CLOUDFLARE_ZONE_ID, TELEGRAM_BOT_TOKEN 和 TELEGRAM_CHAT_ID。") + sys.exit(1) + +# 发送消息到 Telegram +def send_to_telegram(message): + url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" + payload = { + "chat_id": TELEGRAM_CHAT_ID, + "text": message + } + try: + response = requests.post(url, json=payload) + if response.status_code != 200: + logging.error(f"发送消息到 Telegram 失败: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + +# 自定义日志处理器,将日志信息发送到 Telegram +class TelegramLogHandler(logging.Handler): + def emit(self, record): + log_entry = self.format(record) + send_to_telegram(log_entry) + +# 添加 Telegram 日志处理器 +telegram_handler = TelegramLogHandler() +telegram_handler.setLevel(logging.INFO) +telegram_handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")) +logging.getLogger().addHandler(telegram_handler) + +# 域名与标记映射关系(扩展机场三字码) +LOCATION_TO_DOMAIN = { + # 示例映射(可根据实际需求调整) + # 美国 + "🇺🇸SJC": "sjc.616049.xyz", # 圣何塞 + "🇺🇸LAX": "lax.616049.xyz", # 洛杉矶 + "🇺🇸SEA": "sea.616049.xyz", # 西雅图 + "🇺🇸JFK": "jfk.616049.xyz", # 纽约 - 肯尼迪国际机场 + "🇺🇸ORD": "ord.616049.xyz", # 芝加哥 - 奥黑尔国际机场 + "🇺🇸US": "us.616049.xyz", # 美国 + + # 德国 + "🇩🇪FRA": "de.616049.xyz", # 法兰克福机场 + "🇩🇪DE": "de.616049.xyz", # 德国 + + # 英国 + "🇬🇧LHR": "uk.616049.xyz", # 伦敦 + "🇬🇧UK": "uk.616049.xyz", # 英国 + + # 日本 + "🇯🇵NRT": "jp.616049.xyz", # 东京成田 + "🇯🇵HND": "jp.616049.xyz", # 东京羽田 + "🇯🇵JP": "jp.616049.xyz", # 日本 + + # 香港 + "🇭🇰HKG": "hk.616049.xyz", # 香港国际机场 + "🇭🇰HK": "hk.616049.xyz", # 香港 + + # 韩国 + "🇰🇷ICN": "kr.616049.xyz", # 仁川国际机场 + "🇰🇷KR": "kr.616049.xyz", # 韩国 + + # 台湾 + "🇹🇼TPE": "tw.616049.xyz", # 台北桃园机场 + "🇹🇼TW": "tw.616049.xyz", # 台湾 + + # 新加坡 + "🇸🇬SIN": "sg.616049.xyz", # 樟宜机场 + "🇸🇬SG": "sg.616049.xyz", # 新加坡 + + # 芬兰 + "🇫🇮HEL": "fi.616049.xyz", # 赫尔辛基 + "🇫🇮FI": "fi.616049.xyz", # 芬兰 + + # 波兰 + "🇵🇱WAW": "pl.616049.xyz", # 华沙 + "🇵🇱PL": "pl.616049.xyz", # 波兰 + + # CF优选 + "☁️CF优选": "cf.616049.xyz" # CF优选 +} + +# 从 ip.txt 文件中读取前200个 IP 和标记 +def get_ips_from_file(file_path, limit=200): + ip_data = [] + try: + with open(file_path, "r") as file: + for line in file: + if "#" in line: + ip, location = line.strip().split("#") + ip_data.append((ip.strip(), location.strip())) + if len(ip_data) >= limit: + break + return ip_data + except FileNotFoundError: + logging.error(f"文件未找到: {file_path}") + return [] + +# 删除相同前缀的所有 DNS 记录(不保留任何记录) +def delete_dns_records_with_prefix(prefix): + try: + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + response = requests.get(url, headers=headers) + response.raise_for_status() + records = response.json().get("result", []) + logging.info(f"找到 {len(records)} 条 DNS 记录,开始删除与 {prefix} 完全匹配的所有记录...") + + # 过滤出与给定前缀完全匹配的记录(例如 proxy.us) + matching_records = [record for record in records if record["name"].startswith(prefix + ".")] + + # 删除所有匹配的记录 + if matching_records: + for record in matching_records: # 删除所有记录 + record_id = record["id"] + delete_url = f"{url}/{record_id}" + delete_response = requests.delete(delete_url, headers=headers) + if delete_response.status_code == 200: + logging.info(f"已删除记录: {record['name']} -> {record['content']}") + else: + logging.error(f"删除失败: {record['name']} -> {record['content']}, 错误信息: {delete_response.status_code}, {delete_response.text}") + else: + logging.info(f"没有需要删除的记录,{prefix} 前缀的记录数量为 0") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + sys.exit(1) + +# 批量添加 DNS 记录 +def add_dns_records_bulk(ip_data): + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + # 记录已经删除过哪些前缀 + deleted_prefixes = set() + # 记录每个前缀已经添加的记录数量 + prefix_counters = {} + + for ip, location in ip_data: + domain = LOCATION_TO_DOMAIN.get(location) + if domain: + # 提取前缀(例如 "us.616049.xyz" 的前缀是 "us") + prefix = ".".join(domain.split(".")[:1]) # 提取第一部分(us) + # 如果该前缀没有被删除过,则删除该前缀的所有 DNS 记录 + if prefix not in deleted_prefixes: + delete_dns_records_with_prefix(prefix) + deleted_prefixes.add(prefix) # 标记该前缀已删除 + prefix_counters[prefix] = 0 # 初始化计数器 + + # 如果该前缀的记录数量已经达到 5 条,则跳过 + if prefix_counters.get(prefix, 0) >= 5: + logging.info(f"前缀 {prefix} 的记录数量已达到 5 条,跳过添加: {domain} -> {ip}") + continue + + data = { + "type": "A", + "name": domain, + "content": ip, + "ttl": 1, + "proxied": False + } + try: + response = requests.post(url, headers=headers, json=data) + if response.status_code == 200: + logging.info(f"添加成功: {domain} -> {ip}") + prefix_counters[prefix] = prefix_counters.get(prefix, 0) + 1 # 增加计数器 + elif response.status_code == 409: + logging.info(f"记录已存在: {domain} -> {ip}") + else: + logging.error(f"添加失败: {domain} -> {ip}, 错误信息: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + else: + logging.warning(f"未找到标记 {location} 对应的域名映射,跳过。") + +# 主程序 +if __name__ == "__main__": + # 添加新的 DNS 记录 + ip_data = get_ips_from_file("cfip/ip.txt") + if not ip_data: + logging.error("未读取到 IP 数据,请检查 ip.txt 文件格式是否正确。") + else: + add_dns_records_bulk(ip_data) \ No newline at end of file diff --git a/ddns/autoddnsfd.py b/ddns/autoddnsfd.py new file mode 100644 index 0000000..c017252 --- /dev/null +++ b/ddns/autoddnsfd.py @@ -0,0 +1,213 @@ +import os +import requests +import logging +import sys + +# 配置日志 +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=[ + logging.FileHandler("dns_update.log"), + logging.StreamHandler() + ] +) + +# 从环境变量获取 Cloudflare API 配置信息 +API_KEY = os.getenv("CLOUDFLARE_API_KEY") +EMAIL = os.getenv("CLOUDFLARE_EMAIL") +ZONE_ID = os.getenv("CLOUDFLARE_ZONE_ID") +TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") +TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID") + +# 确保从环境变量中获取到了这些信息 +if not all([API_KEY, EMAIL, ZONE_ID, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID]): + logging.error("缺少必要的配置信息,请确保在 GitHub Secrets 中设置了 CLOUDFLARE_API_KEY, CLOUDFLARE_EMAIL, CLOUDFLARE_ZONE_ID, TELEGRAM_BOT_TOKEN 和 TELEGRAM_CHAT_ID。") + sys.exit(1) + +# 发送消息到 Telegram +def send_to_telegram(message): + url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" + payload = { + "chat_id": TELEGRAM_CHAT_ID, + "text": message + } + try: + response = requests.post(url, json=payload) + if response.status_code != 200: + logging.error(f"发送消息到 Telegram 失败: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + +# 自定义日志处理器,将日志信息发送到 Telegram +class TelegramLogHandler(logging.Handler): + def emit(self, record): + log_entry = self.format(record) + send_to_telegram(log_entry) + +# 添加 Telegram 日志处理器 +telegram_handler = TelegramLogHandler() +telegram_handler.setLevel(logging.INFO) +telegram_handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")) +logging.getLogger().addHandler(telegram_handler) + +# 域名与标记映射关系(扩展机场三字码) +LOCATION_TO_DOMAIN = { + # 示例映射(可根据实际需求调整) + # 美国 + "🇺🇸SJC": "proxy.sjc.616049.xyz", # 圣何塞 + "🇺🇸LAX": "proxy.lax.616049.xyz", # 洛杉矶 + "🇺🇸SEA": "proxy.sea.616049.xyz", # 西雅图 + "🇺🇸JFK": "proxy.jfk.616049.xyz", # 纽约 - 肯尼迪国际机场 + "🇺🇸ORD": "proxy.ord.616049.xyz", # 芝加哥 - 奥黑尔国际机场 + "🇺🇸US": "proxy.us.616049.xyz", # 美国 + + # 德国 + "🇩🇪FRA": "proxy.de.616049.xyz", # 法兰克福 + "🇩🇪DE": "proxy.de.616049.xyz", # 德国 + + # 英国 + "🇬🇧LHR": "proxy.uk.616049.xyz", # 伦敦 + "🇬🇧UK": "proxy.uk.616049.xyz", # 英国 + + # 日本 + "🇯🇵NRT": "proxy.jp.616049.xyz", # 东京成田 + "🇯🇵HND": "proxy.jp.616049.xyz", # 东京羽田 + "🇯🇵JP": "proxy.jp.616049.xyz", # 日本 + + # 香港 + "🇭🇰HKG": "proxy.hk.616049.xyz", # 香港国际机场 + "🇭🇰HK": "proxy.hk.616049.xyz", # 香港 + + # 韩国 + "🇰🇷ICN": "proxy.kr.616049.xyz", # 仁川国际机场 + "🇰🇷KR": "proxy.kr.616049.xyz", # 韩国 + + # 台湾 + "🇹🇼TPE": "proxy.tw.616049.xyz", # 台北桃园机场 + "🇹🇼KHH": "proxy.tw.616049.xyz", # 台湾高雄 + "🇹🇼TW": "proxy.tw.616049.xyz", # 台湾 + + # 新加坡 + "🇸🇬SIN": "proxy.sg.616049.xyz", # 樟宜机场 + "🇸🇬SG": "proxy.sg.616049.xyz", # 新加坡 + + # 芬兰 + "🇫🇮HEL": "proxy.fi.616049.xyz", # 赫尔辛基 + "🇫🇮FI": "proxy.fi.616049.xyz", # 芬兰 + + # 波兰 + "🇵🇱WAW": "proxy.pl.616049.xyz", # 华沙 + "🇵🇱PL": "proxy.pl.616049.xyz", # 波兰 + + # Proxy + "☁️Proxy": "proxy.616049.xyz" # Proxy +} + +# 从 cfipfd.txt 文件中读取前200个 IP 和标记 +def get_ips_from_file(file_path, limit=200): + ip_data = [] + try: + with open(file_path, "r") as file: + for line in file: + if "#" in line: + ip, location = line.strip().split("#") + ip_data.append((ip.strip(), location.strip())) + if len(ip_data) >= limit: + break + return ip_data + except FileNotFoundError: + logging.error(f"文件未找到: {file_path}") + return [] + +# 删除相同前缀的所有 DNS 记录(不保留任何记录) +def delete_dns_records_with_prefix(prefix): + try: + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + response = requests.get(url, headers=headers) + response.raise_for_status() + records = response.json().get("result", []) + logging.info(f"找到 {len(records)} 条 DNS 记录,开始删除与 {prefix} 完全匹配的所有记录...") + + # 过滤出与给定前缀完全匹配的记录(例如 proxy.us) + matching_records = [record for record in records if record["name"].startswith(prefix + ".")] + + # 删除所有匹配的记录 + if matching_records: + for record in matching_records: # 删除所有记录 + record_id = record["id"] + delete_url = f"{url}/{record_id}" + delete_response = requests.delete(delete_url, headers=headers) + if delete_response.status_code == 200: + logging.info(f"已删除记录: {record['name']} -> {record['content']}") + else: + logging.error(f"删除失败: {record['name']} -> {record['content']}, 错误信息: {delete_response.status_code}, {delete_response.text}") + else: + logging.info(f"没有需要删除的记录,{prefix} 前缀的记录数量为 0") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + sys.exit(1) + +# 批量添加 DNS 记录 +def add_dns_records_bulk(ip_data): + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + # 记录已经删除过哪些前缀 + deleted_prefixes = set() + # 记录每个前缀已经添加的记录数量 + prefix_counters = {} + + for ip, location in ip_data: + domain = LOCATION_TO_DOMAIN.get(location) + if domain: + # 提取前缀(例如 "proxy.us.616049.xyz" 的前缀是 "proxy.us") + prefix = ".".join(domain.split(".")[:2]) # 提取前两部分(proxy.us) + # 如果该前缀没有被删除过,则删除该前缀的所有 DNS 记录 + if prefix not in deleted_prefixes: + delete_dns_records_with_prefix(prefix) + deleted_prefixes.add(prefix) # 标记该前缀已删除 + prefix_counters[prefix] = 0 # 初始化计数器 + + # 如果该前缀的记录数量已经达到 5 条,则跳过 + if prefix_counters.get(prefix, 0) >= 5: + logging.info(f"前缀 {prefix} 的记录数量已达到 5 条,跳过添加: {domain} -> {ip}") + continue + + data = { + "type": "A", + "name": domain, + "content": ip, + "ttl": 1, + "proxied": False + } + try: + response = requests.post(url, headers=headers, json=data) + if response.status_code == 200: + logging.info(f"添加成功: {domain} -> {ip}") + prefix_counters[prefix] = prefix_counters.get(prefix, 0) + 1 # 增加计数器 + elif response.status_code == 409: + logging.info(f"记录已存在: {domain} -> {ip}") + else: + logging.error(f"添加失败: {domain} -> {ip}, 错误信息: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + else: + logging.warning(f"未找到标记 {location} 对应的域名映射,跳过。") + +# 主程序 +if __name__ == "__main__": + # 添加新的 DNS 记录 + ip_data = get_ips_from_file("cfip/fd.txt") + if not ip_data: + logging.error("未读取到 IP 数据,请检查 fd.txt 文件格式是否正确。") + else: + add_dns_records_bulk(ip_data) \ No newline at end of file diff --git a/ddns/autoddnsv6.py b/ddns/autoddnsv6.py new file mode 100644 index 0000000..e97e88f --- /dev/null +++ b/ddns/autoddnsv6.py @@ -0,0 +1,213 @@ +import os +import requests +import logging +import sys + +# 配置日志 +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s - %(levelname)s - %(message)s", + handlers=[ + logging.FileHandler("dns_update.log"), + logging.StreamHandler() + ] +) + +# 从环境变量获取 Cloudflare API 配置信息 +API_KEY = os.getenv("CLOUDFLARE_API_KEY") +EMAIL = os.getenv("CLOUDFLARE_EMAIL") +ZONE_ID = os.getenv("CLOUDFLARE_ZONE_ID") +TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") +TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID") + +# 确保从环境变量中获取到了这些信息 +if not all([API_KEY, EMAIL, ZONE_ID, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID]): + logging.error("缺少必要的配置信息,请确保在 GitHub Secrets 中设置了 CLOUDFLARE_API_KEY, CLOUDFLARE_EMAIL, CLOUDFLARE_ZONE_ID, TELEGRAM_BOT_TOKEN 和 TELEGRAM_CHAT_ID。") + sys.exit(1) + +# 发送消息到 Telegram +def send_to_telegram(message): + url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" + payload = { + "chat_id": TELEGRAM_CHAT_ID, + "text": message + } + try: + response = requests.post(url, json=payload) + if response.status_code != 200: + logging.error(f"发送消息到 Telegram 失败: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + +# 自定义日志处理器,将日志信息发送到 Telegram +class TelegramLogHandler(logging.Handler): + def emit(self, record): + log_entry = self.format(record) + send_to_telegram(log_entry) + +# 添加 Telegram 日志处理器 +telegram_handler = TelegramLogHandler() +telegram_handler.setLevel(logging.INFO) +telegram_handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")) +logging.getLogger().addHandler(telegram_handler) + +# 域名与标记映射关系 +LOCATION_TO_DOMAIN = { + # 示例映射(可根据实际需求调整) + # 美国 + "🇺🇸SJC": "sjcv6.616049.xyz", # 圣何塞 + "🇺🇸LAX": "laxv6.616049.xyz", # 洛杉矶 + "🇺🇸SEA": "seav6.616049.xyz", # 西雅图 + "🇺🇸JFK": "jfkv6.616049.xyz", # 纽约 - 肯尼迪国际机场 + "🇺🇸ORD": "ordv6.616049.xyz", # 芝加哥 - 奥黑尔国际机场 + "🇺🇸US": "usv6.616049.xyz", # 美国 + + # 德国 + "🇩🇪FRA": "dev6.616049.xyz", # 法兰克福机场 + "🇩🇪DE": "dev6.616049.xyz", # 德国 + + # 英国 + "🇬🇧LHR": "ukv6.616049.xyz", # 伦敦 + "🇬🇧UK": "ukv6.616049.xyz", # 英国 + + # 日本 + "🇯🇵NRT": "jpv6.616049.xyz", # 东京成田 + "🇯🇵HND": "jpv6.616049.xyz", # 东京羽田 + "🇯🇵JP": "jpv6.616049.xyz", # 日本 + + # 香港 + "🇭🇰HKG": "hkv6.616049.xyz", # 香港国际机场 + "🇭🇰HK": "hkv6.616049.xyz", # 香港 + + # 韩国 + "🇰🇷ICN": "krv6.616049.xyz", # 仁川国际机场 + "🇰🇷KR": "krv6.616049.xyz", # 韩国 + + # 台湾 + "🇹🇼TPE": "twv6.616049.xyz", # 台北桃园机场 + "🇹🇼KHH": "proxy.tw.616049.xyz", # 台湾高雄 + "🇹🇼TW": "twv6.616049.xyz", # 台湾 + + # 新加坡 + "🇸🇬SIN": "sgv6.616049.xyz", # 樟宜机场 + "🇸🇬SG": "sgv6.616049.xyz", # 新加坡 + + # 芬兰 + "🇫🇮HEL": "fiv6.616049.xyz", # 赫尔辛基 + "🇫🇮FI": "fiv6.616049.xyz", # 芬兰 + + # 波兰 + "🇵🇱WAW": "plv6.616049.xyz", # 华沙 + "🇵🇱PL": "plv6.616049.xyz", # 波兰 + + # CF优选 + "☁️CFIPV6优选": "cfv6.616049.xyz" # CF优选 +} + +# 从 ipv6.txt 文件中读取前200个 IP 和标记 +def get_ips_from_file(file_path, limit=200): + ip_data = [] + try: + with open(file_path, "r") as file: + for line in file: + if "#" in line: + ip, location = line.strip().split("#") + ip_data.append((ip.strip(), location.strip())) + if len(ip_data) >= limit: + break + return ip_data + except FileNotFoundError: + logging.error(f"文件未找到: {file_path}") + return [] + +# 删除相同前缀的所有 DNS 记录(不保留任何记录) +def delete_dns_records_with_prefix(prefix): + try: + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + response = requests.get(url, headers=headers) + response.raise_for_status() + records = response.json().get("result", []) + logging.info(f"找到 {len(records)} 条 DNS 记录,开始删除与 {prefix} 完全匹配的所有记录...") + + # 过滤出与给定前缀完全匹配的记录(例如 proxy.us) + matching_records = [record for record in records if record["name"].startswith(prefix + ".")] + + # 删除所有匹配的记录 + if matching_records: + for record in matching_records: # 删除所有记录 + record_id = record["id"] + delete_url = f"{url}/{record_id}" + delete_response = requests.delete(delete_url, headers=headers) + if delete_response.status_code == 200: + logging.info(f"已删除记录: {record['name']} -> {record['content']}") + else: + logging.error(f"删除失败: {record['name']} -> {record['content']}, 错误信息: {delete_response.status_code}, {delete_response.text}") + else: + logging.info(f"没有需要删除的记录,{prefix} 前缀的记录数量为 0") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + sys.exit(1) + +# 批量添加 DNS 记录 +def add_dns_records_bulk(ip_data): + url = f"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records" + headers = { + "X-Auth-Email": EMAIL, + "X-Auth-Key": API_KEY, + "Content-Type": "application/json" + } + # 记录已经删除过哪些前缀 + deleted_prefixes = set() + # 记录每个前缀已经添加的记录数量 + prefix_counters = {} + + for ip, location in ip_data: + domain = LOCATION_TO_DOMAIN.get(location) + if domain: + # 提取前缀(例如 "usv6.616049.xyz" 的前缀是 "usv6") + prefix = ".".join(domain.split(".")[:1]) # 提取前两部分(usv6) + # 如果该前缀没有被删除过,则删除该前缀的所有 DNS 记录 + if prefix not in deleted_prefixes: + delete_dns_records_with_prefix(prefix) + deleted_prefixes.add(prefix) # 标记该前缀已删除 + prefix_counters[prefix] = 0 # 初始化计数器 + + # 如果该前缀的记录数量已经达到 5 条,则跳过 + if prefix_counters.get(prefix, 0) >= 5: + logging.info(f"前缀 {prefix} 的记录数量已达到 5 条,跳过添加: {domain} -> {ip}") + continue + + data = { + "type": "AAAA", + "name": domain, + "content": ip, + "ttl": 1, + "proxied": False + } + try: + response = requests.post(url, headers=headers, json=data) + if response.status_code == 200: + logging.info(f"添加成功: {domain} -> {ip}") + prefix_counters[prefix] = prefix_counters.get(prefix, 0) + 1 # 增加计数器 + elif response.status_code == 409: + logging.info(f"记录已存在: {domain} -> {ip}") + else: + logging.error(f"添加失败: {domain} -> {ip}, 错误信息: {response.status_code}, {response.text}") + except requests.exceptions.RequestException as e: + logging.error(f"请求失败: {e}") + else: + logging.warning(f"未找到标记 {location} 对应的域名映射,跳过。") + +# 主程序 +if __name__ == "__main__": + # 添加新的 DNS 记录 + ip_data = get_ips_from_file("cfip/ipv6.txt") + if not ip_data: + logging.error("未读取到 IP 数据,请检查 ipv6.txt 文件格式是否正确。") + else: + add_dns_records_bulk(ip_data) \ No newline at end of file diff --git a/ip.txt b/ip.txt new file mode 100755 index 0000000..969e34b --- /dev/null +++ b/ip.txt @@ -0,0 +1,692 @@ +5.181.224.0/23 +8.208.0.0/19 +8.208.0.0/18 +8.208.0.0/17 +8.208.0.0/16 +8.208.32.0/19 +8.208.128.0/17 +8.208.141.0/24 +8.209.0.0/20 +8.209.0.0/19 +8.209.16.0/20 +8.209.36.0/24 +8.209.36.0/23 +8.209.37.0/24 +8.209.38.0/24 +8.209.38.0/23 +8.209.39.0/24 +8.209.40.0/23 +8.209.40.0/22 +8.209.42.0/23 +8.209.44.0/23 +8.209.44.0/22 +8.209.46.0/23 +8.209.48.0/21 +8.209.48.0/20 +8.209.56.0/21 +8.209.64.0/19 +8.209.64.0/18 +8.209.96.0/19 +8.209.128.0/19 +8.209.128.0/18 +8.209.160.0/19 +8.209.192.0/19 +8.209.192.0/18 +8.209.224.0/19 +8.210.0.0/17 +8.210.0.0/16 +8.210.128.0/17 +8.210.240.0/24 +8.211.0.0/18 +8.211.0.0/17 +8.211.64.0/18 +8.211.80.0/21 +8.211.88.0/21 +8.211.96.0/21 +8.211.104.0/21 +8.211.128.0/19 +8.211.128.0/18 +8.211.160.0/19 +8.211.192.0/19 +8.211.192.0/18 +8.211.224.0/19 +8.211.226.0/24 +8.212.0.0/18 +8.212.0.0/17 +8.212.64.0/18 +8.212.128.0/19 +8.212.128.0/18 +8.212.160.0/19 +8.212.192.0/19 +8.212.192.0/18 +8.212.224.0/19 +8.213.0.0/18 +8.213.0.0/17 +8.213.64.0/18 +8.213.128.0/20 +8.213.128.0/19 +8.213.144.0/20 +8.213.160.0/22 +8.213.160.0/21 +8.213.164.0/22 +8.213.176.0/21 +8.213.176.0/20 +8.213.184.0/21 +8.213.192.0/19 +8.213.192.0/18 +8.213.224.0/19 +8.213.251.0/24 +8.213.252.0/24 +8.213.253.0/24 +8.214.0.0/17 +8.214.0.0/16 +8.214.128.0/17 +8.215.0.0/17 +8.215.0.0/16 +8.215.128.0/17 +8.215.160.0/24 +8.215.162.0/23 +8.215.168.0/24 +8.215.169.0/24 +8.216.0.0/18 +8.216.0.0/17 +8.216.64.0/18 +8.216.69.0/24 +8.216.128.0/18 +8.216.128.0/17 +8.216.148.0/24 +8.216.192.0/18 +8.217.0.0/17 +8.217.0.0/16 +8.217.128.0/17 +8.218.0.0/17 +8.218.0.0/16 +8.218.128.0/17 +8.219.0.0/17 +8.219.0.0/16 +8.219.40.0/21 +8.219.128.0/17 +8.220.64.0/19 +8.220.64.0/18 +8.220.96.0/19 +8.220.116.0/24 +8.220.128.0/19 +8.220.128.0/18 +8.220.147.0/24 +8.220.160.0/19 +8.220.192.0/19 +8.220.192.0/18 +8.220.224.0/19 +8.220.229.0/24 +8.221.0.0/21 +8.221.0.0/18 +8.221.0.0/17 +8.221.8.0/21 +8.221.48.0/21 +8.221.56.0/21 +8.221.64.0/18 +8.221.128.0/18 +8.221.128.0/17 +8.221.184.0/22 +8.221.188.0/22 +8.221.192.0/21 +8.221.192.0/18 +8.221.200.0/21 +8.221.208.0/21 +8.221.216.0/21 +8.222.0.0/21 +8.222.0.0/20 +8.222.8.0/21 +8.222.16.0/21 +8.222.16.0/20 +8.222.24.0/21 +8.222.32.0/21 +8.222.32.0/20 +8.222.40.0/21 +8.222.48.0/21 +8.222.48.0/20 +8.222.56.0/21 +8.222.64.0/21 +8.222.64.0/20 +8.222.72.0/21 +8.222.80.0/21 +8.222.80.0/20 +8.222.88.0/21 +8.222.96.0/20 +8.222.96.0/19 +8.222.112.0/20 +8.222.128.0/18 +8.222.128.0/17 +8.222.192.0/18 +8.223.0.0/18 +8.223.0.0/17 +8.223.64.0/18 +8.223.128.0/18 +8.223.128.0/17 +8.223.192.0/18 +14.1.112.0/22 +14.1.115.0/24 +43.91.0.0/17 +43.91.0.0/16 +43.91.128.0/17 +43.96.0.0/24 +43.96.2.0/24 +43.96.3.0/24 +43.96.4.0/24 +43.96.5.0/24 +43.96.7.0/24 +43.96.8.0/24 +43.96.10.0/24 +43.96.11.0/24 +43.96.16.0/24 +43.96.18.0/24 +43.96.19.0/24 +43.96.20.0/24 +43.96.21.0/24 +43.96.22.0/24 +43.96.23.0/24 +43.96.24.0/24 +43.96.25.0/24 +43.96.26.0/24 +43.96.28.0/24 +43.96.29.0/24 +43.96.32.0/24 +43.96.33.0/24 +43.96.34.0/24 +43.96.35.0/24 +43.96.40.0/24 +43.96.66.0/24 +43.96.67.0/24 +43.96.68.0/24 +43.96.69.0/24 +43.96.70.0/24 +43.96.71.0/24 +43.96.72.0/24 +43.96.73.0/24 +43.96.74.0/24 +43.96.75.0/24 +43.96.78.0/24 +43.96.80.0/24 +43.96.81.0/24 +43.96.85.0/24 +43.96.88.0/24 +43.96.96.0/24 +45.196.28.0/24 +45.199.179.0/24 +47.52.0.0/17 +47.52.0.0/16 +47.52.128.0/17 +47.56.0.0/16 +47.56.0.0/15 +47.57.0.0/16 +47.74.0.0/21 +47.74.0.0/19 +47.74.0.0/18 +47.74.32.0/19 +47.74.128.0/18 +47.74.128.0/17 +47.74.192.0/18 +47.75.0.0/17 +47.75.0.0/16 +47.75.128.0/17 +47.76.0.0/17 +47.76.0.0/16 +47.76.128.0/17 +47.77.0.0/23 +47.77.0.0/22 +47.77.2.0/23 +47.77.4.0/23 +47.77.4.0/22 +47.77.6.0/23 +47.77.8.0/22 +47.77.8.0/21 +47.77.12.0/22 +47.77.16.0/22 +47.77.16.0/21 +47.77.20.0/22 +47.77.24.0/23 +47.77.24.0/22 +47.77.26.0/23 +47.77.32.0/20 +47.77.32.0/19 +47.77.48.0/20 +47.77.64.0/20 +47.77.64.0/19 +47.77.80.0/20 +47.77.96.0/21 +47.77.96.0/20 +47.77.104.0/21 +47.77.128.0/21 +47.77.128.0/18 +47.77.128.0/17 +47.77.136.0/21 +47.77.144.0/21 +47.77.152.0/21 +47.77.192.0/18 +47.78.0.0/17 +47.78.128.0/17 +47.79.0.0/21 +47.79.0.0/20 +47.79.8.0/21 +47.79.16.0/21 +47.79.16.0/20 +47.79.24.0/21 +47.79.32.0/21 +47.79.32.0/20 +47.79.40.0/21 +47.79.48.0/21 +47.79.48.0/20 +47.79.52.0/23 +47.79.54.0/23 +47.79.56.0/23 +47.79.56.0/21 +47.79.58.0/23 +47.79.60.0/23 +47.79.62.0/23 +47.79.64.0/21 +47.79.64.0/20 +47.79.72.0/21 +47.79.80.0/21 +47.79.80.0/20 +47.79.83.0/24 +47.79.88.0/21 +47.79.96.0/20 +47.79.96.0/19 +47.79.104.0/21 +47.79.112.0/20 +47.80.0.0/19 +47.80.0.0/18 +47.80.32.0/19 +47.80.64.0/19 +47.80.64.0/18 +47.80.96.0/19 +47.80.128.0/18 +47.80.128.0/17 +47.80.192.0/18 +47.81.0.0/19 +47.81.0.0/18 +47.81.32.0/19 +47.81.64.0/19 +47.81.64.0/18 +47.81.96.0/19 +47.81.128.0/18 +47.81.128.0/17 +47.81.192.0/18 +47.82.0.0/19 +47.82.0.0/18 +47.82.8.0/23 +47.82.10.0/23 +47.82.12.0/23 +47.82.14.0/23 +47.82.32.0/21 +47.82.32.0/19 +47.82.64.0/19 +47.82.64.0/18 +47.82.96.0/19 +47.83.0.0/17 +47.83.0.0/16 +47.83.32.0/21 +47.83.40.0/21 +47.83.48.0/21 +47.83.56.0/21 +47.83.128.0/17 +47.84.0.0/17 +47.84.0.0/16 +47.84.128.0/17 +47.84.144.0/21 +47.84.152.0/21 +47.84.160.0/21 +47.84.168.0/21 +47.85.0.0/17 +47.85.0.0/16 +47.85.112.0/23 +47.85.112.0/22 +47.85.114.0/23 +47.85.128.0/17 +47.86.0.0/17 +47.86.0.0/16 +47.86.128.0/17 +47.87.0.0/19 +47.87.0.0/18 +47.87.32.0/19 +47.87.64.0/19 +47.87.64.0/18 +47.87.96.0/19 +47.87.128.0/19 +47.87.128.0/18 +47.87.160.0/19 +47.88.0.0/18 +47.88.0.0/17 +47.88.41.0/24 +47.88.42.0/24 +47.88.43.0/24 +47.88.64.0/18 +47.88.109.0/24 +47.88.128.0/18 +47.88.128.0/17 +47.88.135.0/24 +47.88.192.0/18 +47.89.0.0/19 +47.89.0.0/18 +47.89.32.0/19 +47.89.72.0/23 +47.89.72.0/22 +47.89.74.0/23 +47.89.76.0/23 +47.89.76.0/22 +47.89.78.0/23 +47.89.80.0/23 +47.89.82.0/23 +47.89.84.0/24 +47.89.88.0/23 +47.89.88.0/22 +47.89.90.0/23 +47.89.92.0/23 +47.89.92.0/22 +47.89.94.0/23 +47.89.96.0/24 +47.89.97.0/24 +47.89.98.0/23 +47.89.99.0/24 +47.89.100.0/24 +47.89.101.0/24 +47.89.102.0/24 +47.89.103.0/24 +47.89.104.0/22 +47.89.104.0/21 +47.89.108.0/22 +47.89.122.0/24 +47.89.123.0/24 +47.89.124.0/24 +47.89.124.0/23 +47.89.125.0/24 +47.89.128.0/19 +47.89.128.0/18 +47.89.160.0/19 +47.89.192.0/19 +47.89.192.0/18 +47.89.221.0/24 +47.89.224.0/19 +47.90.0.0/18 +47.90.0.0/17 +47.90.64.0/18 +47.90.128.0/18 +47.90.128.0/17 +47.90.192.0/18 +47.91.0.0/20 +47.91.0.0/19 +47.91.16.0/20 +47.91.64.0/20 +47.91.64.0/19 +47.91.80.0/20 +47.91.96.0/20 +47.91.96.0/19 +47.91.112.0/20 +47.91.128.0/18 +47.91.128.0/17 +47.91.192.0/18 +47.235.0.0/23 +47.235.0.0/22 +47.235.1.0/24 +47.235.2.0/23 +47.235.4.0/24 +47.235.5.0/24 +47.235.6.0/24 +47.235.6.0/23 +47.235.7.0/24 +47.235.8.0/24 +47.235.9.0/24 +47.235.10.0/24 +47.235.10.0/23 +47.235.11.0/24 +47.235.12.0/24 +47.235.12.0/23 +47.235.13.0/24 +47.235.16.0/24 +47.235.16.0/23 +47.235.18.0/24 +47.235.18.0/23 +47.235.19.0/24 +47.235.20.0/24 +47.235.21.0/24 +47.235.22.0/24 +47.235.23.0/24 +47.235.24.0/23 +47.235.24.0/22 +47.235.26.0/23 +47.235.28.0/24 +47.235.28.0/23 +47.235.29.0/24 +47.235.30.0/24 +47.235.31.0/24 +47.236.0.0/16 +47.236.0.0/15 +47.237.0.0/16 +47.237.32.0/20 +47.237.34.0/24 +47.237.248.0/24 +47.238.0.0/16 +47.238.0.0/15 +47.239.0.0/16 +47.240.0.0/17 +47.240.0.0/16 +47.240.128.0/17 +47.241.0.0/17 +47.241.0.0/16 +47.241.128.0/17 +47.242.0.0/16 +47.242.0.0/15 +47.243.0.0/16 +47.244.0.0/17 +47.244.0.0/16 +47.244.73.0/24 +47.244.128.0/17 +47.245.0.0/19 +47.245.0.0/18 +47.245.32.0/19 +47.245.64.0/19 +47.245.64.0/18 +47.245.96.0/19 +47.245.128.0/18 +47.245.128.0/17 +47.245.192.0/18 +47.246.32.0/22 +47.246.64.0/24 +47.246.66.0/24 +47.246.67.0/24 +47.246.68.0/24 +47.246.68.0/23 +47.246.69.0/24 +47.246.72.0/22 +47.246.72.0/21 +47.246.76.0/22 +47.246.80.0/24 +47.246.82.0/24 +47.246.82.0/23 +47.246.83.0/24 +47.246.84.0/23 +47.246.84.0/22 +47.246.86.0/23 +47.246.88.0/23 +47.246.88.0/22 +47.246.90.0/23 +47.246.92.0/24 +47.246.92.0/23 +47.246.93.0/24 +47.246.96.0/22 +47.246.96.0/21 +47.246.100.0/22 +47.246.104.0/22 +47.246.104.0/21 +47.246.108.0/22 +47.246.120.0/24 +47.246.122.0/24 +47.246.123.0/24 +47.246.124.0/24 +47.246.125.0/24 +47.246.128.0/23 +47.246.128.0/22 +47.246.130.0/23 +47.246.132.0/23 +47.246.132.0/22 +47.246.134.0/23 +47.246.136.0/22 +47.246.136.0/21 +47.246.140.0/22 +47.246.144.0/24 +47.246.144.0/23 +47.246.145.0/24 +47.246.146.0/24 +47.246.146.0/23 +47.246.147.0/24 +47.246.150.0/24 +47.246.150.0/23 +47.246.151.0/24 +47.246.152.0/24 +47.246.152.0/23 +47.246.153.0/24 +47.246.154.0/24 +47.246.155.0/24 +47.246.156.0/23 +47.246.156.0/22 +47.246.158.0/23 +47.246.160.0/21 +47.246.160.0/20 +47.246.168.0/21 +47.246.176.0/21 +47.246.176.0/20 +47.246.184.0/21 +47.246.192.0/23 +47.246.192.0/22 +47.246.194.0/23 +47.246.196.0/23 +47.246.196.0/22 +47.246.198.0/23 +47.250.0.0/18 +47.250.0.0/17 +47.250.64.0/18 +47.250.99.0/24 +47.250.128.0/18 +47.250.128.0/17 +47.250.192.0/18 +47.251.0.0/17 +47.251.0.0/16 +47.251.128.0/17 +47.251.224.0/22 +47.252.0.0/18 +47.252.0.0/17 +47.252.64.0/18 +47.252.67.0/24 +47.253.0.0/17 +47.253.0.0/16 +47.253.128.0/17 +47.254.0.0/18 +47.254.0.0/17 +47.254.64.0/18 +47.254.113.0/24 +47.254.128.0/19 +47.254.128.0/18 +47.254.160.0/19 +47.254.192.0/19 +47.254.192.0/18 +47.254.224.0/19 +59.82.136.0/23 +103.81.186.0/23 +110.76.21.0/24 +110.76.23.0/24 +116.251.64.0/18 +139.95.0.0/23 +139.95.2.0/23 +139.95.4.0/23 +139.95.6.0/23 +139.95.8.0/23 +139.95.10.0/23 +139.95.12.0/23 +139.95.14.0/23 +139.95.16.0/23 +139.95.18.0/23 +139.95.64.0/24 +140.205.1.0/24 +140.205.122.0/24 +147.139.128.0/18 +147.139.128.0/17 +147.139.192.0/18 +149.129.0.0/21 +149.129.0.0/20 +149.129.8.0/21 +149.129.16.0/23 +149.129.32.0/19 +149.129.64.0/19 +149.129.64.0/18 +149.129.96.0/19 +149.129.192.0/19 +149.129.192.0/18 +149.129.224.0/19 +156.227.20.0/24 +156.236.12.0/24 +156.236.17.0/24 +156.240.76.0/23 +156.245.1.0/24 +161.117.0.0/24 +161.117.0.0/17 +161.117.0.0/16 +161.117.126.0/24 +161.117.127.0/24 +161.117.128.0/24 +161.117.128.0/17 +161.117.129.0/24 +161.117.138.0/24 +161.117.143.0/24 +170.33.24.0/24 +170.33.29.0/24 +170.33.30.0/24 +170.33.31.0/24 +170.33.32.0/24 +170.33.33.0/24 +170.33.34.0/24 +170.33.35.0/24 +170.33.64.0/24 +170.33.65.0/24 +170.33.66.0/24 +170.33.68.0/24 +170.33.69.0/24 +170.33.72.0/24 +170.33.73.0/24 +170.33.74.0/24 +170.33.75.0/24 +170.33.76.0/24 +170.33.77.0/24 +170.33.78.0/24 +170.33.79.0/24 +170.33.80.0/24 +170.33.81.0/24 +170.33.82.0/24 +170.33.83.0/24 +170.33.84.0/24 +170.33.85.0/24 +170.33.86.0/24 +170.33.88.0/24 +170.33.90.0/24 +170.33.92.0/24 +170.33.93.0/24 +170.33.104.0/24 +170.33.105.0/24 +170.33.106.0/24 +170.33.107.0/24 +185.78.106.0/23 +198.11.128.0/18 +198.11.137.0/24 +198.11.184.0/21 +202.144.199.0/24 +203.107.64.0/24 +203.107.65.0/24 +203.107.66.0/24 +203.107.67.0/24 +203.107.68.0/24 +205.204.96.0/19 +205.204.102.0/23 +205.204.111.0/24 +205.204.117.0/24 +205.204.125.0/24 +223.5.5.0/24 +223.6.6.0/24 diff --git a/ipv6.txt b/ipv6.txt new file mode 100755 index 0000000..7cb8cc5 --- /dev/null +++ b/ipv6.txt @@ -0,0 +1,97 @@ +2400:cb00:2049::/48 +2400:cb00:f00e::/48 +2606:4700::/32 +2606:4700:10::/48 +2606:4700:130::/48 +2606:4700:3000::/48 +2606:4700:3001::/48 +2606:4700:3002::/48 +2606:4700:3003::/48 +2606:4700:3004::/48 +2606:4700:3005::/48 +2606:4700:3006::/48 +2606:4700:3007::/48 +2606:4700:3008::/48 +2606:4700:3009::/48 +2606:4700:3010::/48 +2606:4700:3011::/48 +2606:4700:3012::/48 +2606:4700:3013::/48 +2606:4700:3014::/48 +2606:4700:3015::/48 +2606:4700:3016::/48 +2606:4700:3017::/48 +2606:4700:3018::/48 +2606:4700:3019::/48 +2606:4700:3020::/48 +2606:4700:3021::/48 +2606:4700:3022::/48 +2606:4700:3023::/48 +2606:4700:3024::/48 +2606:4700:3025::/48 +2606:4700:3026::/48 +2606:4700:3027::/48 +2606:4700:3028::/48 +2606:4700:3029::/48 +2606:4700:3030::/48 +2606:4700:3031::/48 +2606:4700:3032::/48 +2606:4700:3033::/48 +2606:4700:3034::/48 +2606:4700:3035::/48 +2606:4700:3036::/48 +2606:4700:3037::/48 +2606:4700:3038::/48 +2606:4700:3039::/48 +2606:4700:a0::/48 +2606:4700:a1::/48 +2606:4700:a8::/48 +2606:4700:a9::/48 +2606:4700:a::/48 +2606:4700:b::/48 +2606:4700:c::/48 +2606:4700:d0::/48 +2606:4700:d1::/48 +2606:4700:d::/48 +2606:4700:e0::/48 +2606:4700:e1::/48 +2606:4700:e2::/48 +2606:4700:e3::/48 +2606:4700:e4::/48 +2606:4700:e5::/48 +2606:4700:e6::/48 +2606:4700:e7::/48 +2606:4700:e::/48 +2606:4700:f1::/48 +2606:4700:f2::/48 +2606:4700:f3::/48 +2606:4700:f4::/48 +2606:4700:f5::/48 +2606:4700:f::/48 +2803:f800:50::/48 +2803:f800:51::/48 +2a06:98c1:3100::/48 +2a06:98c1:3101::/48 +2a06:98c1:3102::/48 +2a06:98c1:3103::/48 +2a06:98c1:3104::/48 +2a06:98c1:3105::/48 +2a06:98c1:3106::/48 +2a06:98c1:3107::/48 +2a06:98c1:3108::/48 +2a06:98c1:3109::/48 +2a06:98c1:310a::/48 +2a06:98c1:310b::/48 +2a06:98c1:310c::/48 +2a06:98c1:310d::/48 +2a06:98c1:310e::/48 +2a06:98c1:310f::/48 +2a06:98c1:3120::/48 +2a06:98c1:3121::/48 +2a06:98c1:3122::/48 +2a06:98c1:3123::/48 +2a06:98c1:3200::/48 +2a06:98c1:50::/48 +2a06:98c1:51::/48 +2a06:98c1:54::/48 +2a06:98c1:58::/48 \ No newline at end of file diff --git a/log/delete_log.txt b/log/delete_log.txt new file mode 100644 index 0000000..a867f1e --- /dev/null +++ b/log/delete_log.txt @@ -0,0 +1,7 @@ +删除时间: 2025-01-17 05:56:06.976509 +删除 IP: 104.67.49.62, 端口: 443 +删除 IP: 104.1.69.12, 端口: 443 + +删除时间: 2025-01-19 04:50:55.991083 +删除 IP: 9606:600:16:f46b:16ee:8079:460b:46c9, 端口: 2087 + diff --git a/log/fdlog.txt b/log/fdlog.txt new file mode 100644 index 0000000..9676d76 --- /dev/null +++ b/log/fdlog.txt @@ -0,0 +1 @@ +以下IP地址不通,已从文件中删除(检测时间: 2025-01-30 08:58:10.536619): diff --git a/log/ip_check.log b/log/ip_check.log new file mode 100644 index 0000000..e69de29 diff --git a/log/ipv6log2.txt b/log/ipv6log2.txt new file mode 100644 index 0000000..5ab3d70 --- /dev/null +++ b/log/ipv6log2.txt @@ -0,0 +1,69 @@ +2025-01-31 03:07:28,519 - INFO - 加载 17 个 IP 地址 +2025-01-31 03:07:28,519 - INFO - 检测 IP: 2606:4700:f4:52:47b5:8b11:d97c:9f05:2087 +2025-01-31 03:07:28,534 - WARNING - IP 2606:4700:f4:52:47b5:8b11:d97c:9f05 第 1 次 Ping 失败 +2025-01-31 03:07:29,551 - WARNING - IP 2606:4700:f4:52:47b5:8b11:d97c:9f05 第 2 次 Ping 失败 +2025-01-31 03:07:30,581 - WARNING - IP 2606:4700:f4:52:47b5:8b11:d97c:9f05 第 3 次 Ping 失败 +2025-01-31 03:07:31,582 - WARNING - IP 2606:4700:f4:52:47b5:8b11:d97c:9f05 Ping 不可达,删除 +2025-01-31 03:07:31,584 - INFO - IP 2606:4700:f4:52:47b5:8b11:d97c:9f05 已从文件中删除 +2025-01-31 03:07:31,584 - INFO - 检测 IP: 2606:4700:a8:c7:9b27:433e:9914:6013:2087 +2025-01-31 03:07:31,614 - WARNING - IP 2606:4700:a8:c7:9b27:433e:9914:6013 第 1 次 Ping 失败 +2025-01-31 03:07:32,645 - WARNING - IP 2606:4700:a8:c7:9b27:433e:9914:6013 第 2 次 Ping 失败 +2025-01-31 03:07:33,680 - WARNING - IP 2606:4700:a8:c7:9b27:433e:9914:6013 第 3 次 Ping 失败 +2025-01-31 03:07:34,681 - WARNING - IP 2606:4700:a8:c7:9b27:433e:9914:6013 Ping 不可达,删除 +2025-01-31 03:07:34,683 - INFO - IP 2606:4700:a8:c7:9b27:433e:9914:6013 已从文件中删除 +2025-01-31 03:07:34,684 - INFO - 检测 IP: 2606:4700:3037:729d:9966:5391:4935:7d2c:2087 +2025-01-31 03:07:34,714 - WARNING - IP 2606:4700:3037:729d:9966:5391:4935:7d2c 第 1 次 Ping 失败 +2025-01-31 03:07:35,745 - WARNING - IP 2606:4700:3037:729d:9966:5391:4935:7d2c 第 2 次 Ping 失败 +2025-01-31 03:07:36,775 - WARNING - IP 2606:4700:3037:729d:9966:5391:4935:7d2c 第 3 次 Ping 失败 +2025-01-31 03:07:37,776 - WARNING - IP 2606:4700:3037:729d:9966:5391:4935:7d2c Ping 不可达,删除 +2025-01-31 03:07:37,778 - INFO - IP 2606:4700:3037:729d:9966:5391:4935:7d2c 已从文件中删除 +2025-01-31 03:07:37,779 - INFO - 检测 IP: 2606:4700:f4:52:9a55:17c0:370c:b77:2087 +2025-01-31 03:07:37,808 - WARNING - IP 2606:4700:f4:52:9a55:17c0:370c:b77 第 1 次 Ping 失败 +2025-01-31 03:07:38,838 - WARNING - IP 2606:4700:f4:52:9a55:17c0:370c:b77 第 2 次 Ping 失败 +2025-01-31 03:07:39,868 - WARNING - IP 2606:4700:f4:52:9a55:17c0:370c:b77 第 3 次 Ping 失败 +2025-01-31 03:07:40,869 - WARNING - IP 2606:4700:f4:52:9a55:17c0:370c:b77 Ping 不可达,删除 +2025-01-31 03:07:40,871 - INFO - IP 2606:4700:f4:52:9a55:17c0:370c:b77 已从文件中删除 +2025-01-31 03:07:40,872 - INFO - 检测 IP: 2606:4700:3036:ed9:830b:d75f:5c05:53aa:2087 +2025-01-31 03:07:40,900 - WARNING - IP 2606:4700:3036:ed9:830b:d75f:5c05:53aa 第 1 次 Ping 失败 +2025-01-31 03:07:41,928 - WARNING - IP 2606:4700:3036:ed9:830b:d75f:5c05:53aa 第 2 次 Ping 失败 +2025-01-31 03:07:42,955 - WARNING - IP 2606:4700:3036:ed9:830b:d75f:5c05:53aa 第 3 次 Ping 失败 +2025-01-31 03:07:43,956 - WARNING - IP 2606:4700:3036:ed9:830b:d75f:5c05:53aa Ping 不可达,删除 +2025-01-31 03:07:43,957 - INFO - IP 2606:4700:3036:ed9:830b:d75f:5c05:53aa 已从文件中删除 +2025-01-31 03:07:43,958 - INFO - 检测 IP: 2606:4700:3032:b022:1982:fc07:7fa6:5ffc:2087 +2025-01-31 03:07:43,987 - WARNING - IP 2606:4700:3032:b022:1982:fc07:7fa6:5ffc 第 1 次 Ping 失败 +2025-01-31 03:07:45,016 - WARNING - IP 2606:4700:3032:b022:1982:fc07:7fa6:5ffc 第 2 次 Ping 失败 +2025-01-31 03:07:46,045 - WARNING - IP 2606:4700:3032:b022:1982:fc07:7fa6:5ffc 第 3 次 Ping 失败 +2025-01-31 03:07:47,048 - WARNING - IP 2606:4700:3032:b022:1982:fc07:7fa6:5ffc Ping 不可达,删除 +2025-01-31 03:07:47,049 - INFO - IP 2606:4700:3032:b022:1982:fc07:7fa6:5ffc 已从文件中删除 +2025-01-31 03:07:47,049 - INFO - 检测 IP: 2606:4700:3037:0:e2b7:1a07:1528:5ca5:2087 +2025-01-31 03:07:47,095 - WARNING - IP 2606:4700:3037:0:e2b7:1a07:1528:5ca5 第 1 次 Ping 失败 +2025-01-31 03:07:48,115 - WARNING - IP 2606:4700:3037:0:e2b7:1a07:1528:5ca5 第 2 次 Ping 失败 +2025-01-31 03:07:49,150 - WARNING - IP 2606:4700:3037:0:e2b7:1a07:1528:5ca5 第 3 次 Ping 失败 +2025-01-31 03:07:50,151 - WARNING - IP 2606:4700:3037:0:e2b7:1a07:1528:5ca5 Ping 不可达,删除 +2025-01-31 03:07:50,153 - INFO - IP 2606:4700:3037:0:e2b7:1a07:1528:5ca5 已从文件中删除 +2025-01-31 03:07:50,154 - INFO - 检测 IP: 2606:4700:3032:50:89ed:9d4c:1cb5:4400:2087 +2025-01-31 03:07:50,182 - WARNING - IP 2606:4700:3032:50:89ed:9d4c:1cb5:4400 第 1 次 Ping 失败 +2025-01-31 03:07:51,209 - WARNING - IP 2606:4700:3032:50:89ed:9d4c:1cb5:4400 第 2 次 Ping 失败 +2025-01-31 03:07:52,235 - WARNING - IP 2606:4700:3032:50:89ed:9d4c:1cb5:4400 第 3 次 Ping 失败 +2025-01-31 03:07:53,236 - WARNING - IP 2606:4700:3032:50:89ed:9d4c:1cb5:4400 Ping 不可达,删除 +2025-01-31 03:07:53,237 - INFO - IP 2606:4700:3032:50:89ed:9d4c:1cb5:4400 已从文件中删除 +2025-01-31 03:07:53,237 - INFO - 检测 IP: 2606:4700:3033:7c3b:79b8:94da:5076:90ab:2087 +2025-01-31 03:07:53,256 - WARNING - IP 2606:4700:3033:7c3b:79b8:94da:5076:90ab 第 1 次 Ping 失败 +2025-01-31 03:07:54,287 - WARNING - IP 2606:4700:3033:7c3b:79b8:94da:5076:90ab 第 2 次 Ping 失败 +2025-01-31 03:07:55,318 - WARNING - IP 2606:4700:3033:7c3b:79b8:94da:5076:90ab 第 3 次 Ping 失败 +2025-01-31 03:07:56,319 - WARNING - IP 2606:4700:3033:7c3b:79b8:94da:5076:90ab Ping 不可达,删除 +2025-01-31 03:07:56,321 - INFO - IP 2606:4700:3033:7c3b:79b8:94da:5076:90ab 已从文件中删除 +2025-01-31 03:07:56,321 - INFO - 检测 IP: 2606:4700:3034:ca6f:a064:d81d:54a4:6cf:2087 +2025-01-31 03:07:56,351 - WARNING - IP 2606:4700:3034:ca6f:a064:d81d:54a4:6cf 第 1 次 Ping 失败 +2025-01-31 03:07:57,382 - WARNING - IP 2606:4700:3034:ca6f:a064:d81d:54a4:6cf 第 2 次 Ping 失败 +2025-01-31 03:07:58,410 - WARNING - IP 2606:4700:3034:ca6f:a064:d81d:54a4:6cf 第 3 次 Ping 失败 +2025-01-31 03:07:59,411 - WARNING - IP 2606:4700:3034:ca6f:a064:d81d:54a4:6cf Ping 不可达,删除 +2025-01-31 03:07:59,414 - INFO - IP 2606:4700:3034:ca6f:a064:d81d:54a4:6cf 已从文件中删除 +2025-01-31 03:07:59,415 - INFO - 检测 IP: 2606:4700:3036:ed9:830b:d714:8f77:da2:2087 +2025-01-31 03:07:59,447 - WARNING - IP 2606:4700:3036:ed9:830b:d714:8f77:da2 第 1 次 Ping 失败 +2025-01-31 03:08:00,478 - WARNING - IP 2606:4700:3036:ed9:830b:d714:8f77:da2 第 2 次 Ping 失败 +2025-01-31 03:08:01,507 - WARNING - IP 2606:4700:3036:ed9:830b:d714:8f77:da2 第 3 次 Ping 失败 +2025-01-31 03:08:02,508 - WARNING - IP 2606:4700:3036:ed9:830b:d714:8f77:da2 Ping 不可达,删除 +2025-01-31 03:08:02,510 - INFO - IP 2606:4700:3036:ed9:830b:d714:8f77:da2 已从文件中删除 +2025-01-31 03:08:02,510 - INFO - 检测 IP: 2606:4700:f4:b4a7:e56b:b6d5:bda9:c602:2087 +2025-01-31 03:08:02,543 - WARNING - IP 2606:4700:f4:b4a7:e56b:b6d5:bda9:c602 第 1 次 Ping 失败 diff --git a/log/v6log.txt b/log/v6log.txt new file mode 100644 index 0000000..d83095e --- /dev/null +++ b/log/v6log.txt @@ -0,0 +1,1794 @@ +完整数据来自 2a06:98c1:3122:a9:9fb0:4ac9:933b:df3f: +{ + "ip": "2a06:98c1:3122:a9:9fb0:4ac9:933b:df3f", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:0:c8b1:8f93:7c4d:e9d: +{ + "ip": "2a06:98c1:3120:0:c8b1:8f93:7c4d:e9d", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4::3770:4e73:2b40: +{ + "ip": "2606:4700:f4::3770:4e73:2b40", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4::b038:5e97:9f4d: +{ + "ip": "2606:4700:f4::b038:5e97:9f4d", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:d9:8a52:5f61:348e:fd1c: +{ + "ip": "2a06:98c1:3120:d9:8a52:5f61:348e:fd1c", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3122:ab94:b382:61ec:641:7c59: +{ + "ip": "2a06:98c1:3122:ab94:b382:61ec:641:7c59", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:0:d362:f735:2339:30f5: +{ + "ip": "2a06:98c1:3123:0:d362:f735:2339:30f5", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a746:dac5:3663:1b5:1db0: +{ + "ip": "2a06:98c1:3123:a746:dac5:3663:1b5:1db0", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123::da:b0a3:f403: +{ + "ip": "2a06:98c1:3123::da:b0a3:f403", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120::acb9:360e: +{ + "ip": "2a06:98c1:3120::acb9:360e", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:d0:b6fb:f6f8:8063:dfd8: +{ + "ip": "2a06:98c1:3120:d0:b6fb:f6f8:8063:dfd8", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a7f3:307f:82c3:646d:7d0a: +{ + "ip": "2a06:98c1:3123:a7f3:307f:82c3:646d:7d0a", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:314f:416e:79c9:2b30:2e: +{ + "ip": "2606:4700:f4:314f:416e:79c9:2b30:2e", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3122:ab94:b382:eeae:af5c:d155: +{ + "ip": "2a06:98c1:3122:ab94:b382:eeae:af5c:d155", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:d2:6d63:5557:b9c3:4de7: +{ + "ip": "2a06:98c1:3123:d2:6d63:5557:b9c3:4de7", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:0:80:3441:d64b:eb21: +{ + "ip": "2a06:98c1:3120:0:80:3441:d64b:eb21", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a7f3:3060:b5fb:91c8:92a6: +{ + "ip": "2a06:98c1:3123:a7f3:3060:b5fb:91c8:92a6", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:d2:6d63:5557:2165:ed8f: +{ + "ip": "2a06:98c1:3123:d2:6d63:5557:2165:ed8f", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:c:97a1:ab95:80de:f89: +{ + "ip": "2606:4700:f4:c:97a1:ab95:80de:f89", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:e6:8e08:52d3:9b68:a0d6: +{ + "ip": "2606:4700:f4:e6:8e08:52d3:9b68:a0d6", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3122:a9:9fb0:4ac9:933b:df3f: +{ + "ip": "2a06:98c1:3122:a9:9fb0:4ac9:933b:df3f", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:0:c8b1:8f93:7c4d:e9d: +{ + "ip": "2a06:98c1:3120:0:c8b1:8f93:7c4d:e9d", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4::3770:4e73:2b40: +{ + "ip": "2606:4700:f4::3770:4e73:2b40", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4::b038:5e97:9f4d: +{ + "ip": "2606:4700:f4::b038:5e97:9f4d", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:d9:8a52:5f61:348e:fd1c: +{ + "ip": "2a06:98c1:3120:d9:8a52:5f61:348e:fd1c", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3122:ab94:b382:61ec:641:7c59: +{ + "ip": "2a06:98c1:3122:ab94:b382:61ec:641:7c59", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:0:d362:f735:2339:30f5: +{ + "ip": "2a06:98c1:3123:0:d362:f735:2339:30f5", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a746:dac5:3663:1b5:1db0: +{ + "ip": "2a06:98c1:3123:a746:dac5:3663:1b5:1db0", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123::da:b0a3:f403: +{ + "ip": "2a06:98c1:3123::da:b0a3:f403", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120::acb9:360e: +{ + "ip": "2a06:98c1:3120::acb9:360e", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:d0:b6fb:f6f8:8063:dfd8: +{ + "ip": "2a06:98c1:3120:d0:b6fb:f6f8:8063:dfd8", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a7f3:307f:82c3:646d:7d0a: +{ + "ip": "2a06:98c1:3123:a7f3:307f:82c3:646d:7d0a", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:314f:416e:79c9:2b30:2e: +{ + "ip": "2606:4700:f4:314f:416e:79c9:2b30:2e", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3122:ab94:b382:eeae:af5c:d155: +{ + "ip": "2a06:98c1:3122:ab94:b382:eeae:af5c:d155", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3122::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:d2:6d63:5557:b9c3:4de7: +{ + "ip": "2a06:98c1:3123:d2:6d63:5557:b9c3:4de7", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3120:0:80:3441:d64b:eb21: +{ + "ip": "2a06:98c1:3120:0:80:3441:d64b:eb21", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3120::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:a7f3:3060:b5fb:91c8:92a6: +{ + "ip": "2a06:98c1:3123:a7f3:3060:b5fb:91c8:92a6", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2a06:98c1:3123:d2:6d63:5557:2165:ed8f: +{ + "ip": "2a06:98c1:3123:d2:6d63:5557:2165:ed8f", + "city": "Munich", + "region": "Bavaria", + "country": "DE", + "loc": "48.1345,11.5710", + "postal": "80331", + "timezone": "Europe/Berlin", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2a06:98c1:3123::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "101 Townsend Street, San Francisco, CA 94107, US", + "country": "DE", + "email": "abuse@cloudflare.com", + "name": "Cloudflare, Inc.", + "network": "2a06:98c1::/32", + "phone": "+49 89 2555 2276" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:c:97a1:ab95:80de:f89: +{ + "ip": "2606:4700:f4:c:97a1:ab95:80de:f89", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "page": 0, + "total": 0, + "domains": [] + } +} + +完整数据来自 2606:4700:f4:e6:8e08:52d3:9b68:a0d6: +{ + "ip": "2606:4700:f4:e6:8e08:52d3:9b68:a0d6", + "city": "San Francisco", + "region": "California", + "country": "US", + "loc": "37.7621,-122.3971", + "postal": "94107", + "timezone": "America/Los_Angeles", + "anycast": true, + "asn": { + "asn": "AS13335", + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "route": "2606:4700:f4::/48", + "type": "hosting" + }, + "company": { + "name": "Cloudflare, Inc.", + "domain": "cloudflare.com", + "type": "hosting" + }, + "privacy": { + "vpn": false, + "proxy": false, + "tor": false, + "relay": false, + "hosting": true, + "service": "" + }, + "abuse": { + "address": "US, CA, San Francisco, 101 Townsend Street, 94107", + "country": "US", + "email": "abuse@cloudflare.com", + "name": "Abuse", + "network": "2606:4700::/32", + "phone": "+1-650-319-8930" + }, + "domains": { + "total": 0, + "domains": [] + } +} + diff --git a/proxy.txt b/proxy.txt new file mode 100644 index 0000000..f680926 --- /dev/null +++ b/proxy.txt @@ -0,0 +1,1036 @@ +8.219.111.115 +141.147.187.233 +143.47.187.137 +8.218.155.238 +8.219.67.198 +8.219.141.47 +158.178.245.161 +141.147.96.98 +152.70.90.168 +8.219.93.5 +8.218.3.198 +143.47.181.113 +129.80.40.82 +152.69.219.32 +131.186.33.175 +168.138.185.234 +150.230.100.115 +158.101.209.178 +141.147.16.152 +141.147.60.78 +129.153.175.17 +8.219.178.244 +141.148.225.177 +141.147.82.89 +150.230.102.199 +140.238.22.17 +143.47.248.63 +141.148.234.51 +8.219.57.216 +8.219.122.12 +8.222.175.135 +129.153.153.208 +129.159.199.92 +152.67.130.10 +8.219.164.242 +147.139.181.165 +8.217.121.207 +141.148.242.113 +130.61.83.37 +8.219.108.86 +8.219.120.87 +141.147.14.196 +132.226.135.219 +152.70.247.181 +158.101.207.254 +8.210.69.31 +8.219.235.132 +152.67.140.139 +130.162.216.61 +144.24.162.114 +141.148.242.98 +141.144.201.62 +8.219.133.246 +152.70.45.244 +138.2.153.253 +152.67.148.199 +143.47.181.51 +8.219.9.239 +129.159.207.252 +141.148.75.133 +141.148.231.143 +152.70.21.141 +138.2.16.224 +144.21.60.101 +8.219.191.45 +155.248.167.55 +8.219.208.23 +130.162.32.172 +141.147.52.157 +130.162.177.61 +141.147.92.158 +138.2.127.186 +47.253.152.99 +8.217.181.213 +47.242.155.183 +132.226.171.35 +144.24.160.240 +155.248.187.195 +47.243.51.171 +8.222.134.170 +132.226.238.234 +152.67.149.10 +129.159.9.193 +204.216.216.148 +168.138.50.249 +132.226.193.101 +138.2.135.240 +8.210.48.107 +138.3.254.142 +8.219.3.155 +138.2.144.172 +141.148.247.43 +47.253.171.149 +8.222.144.152 +8.219.255.86 +132.145.81.117 +141.147.82.220 +152.70.51.184 +150.230.147.113 +130.162.161.114 +131.186.17.132 +150.230.44.13 +130.162.225.160 +152.70.255.133 +130.162.210.190 +129.146.160.114 +8.219.1.92 +8.222.130.116 +8.219.245.144 +130.162.162.248 +8.219.150.127 +141.148.203.6 +152.67.140.238 +8.219.192.188 +144.24.80.56 +141.147.84.187 +144.24.243.207 +8.212.48.236 +141.148.235.244 +8.219.86.75 +138.2.18.250 +152.70.42.7 +47.242.119.104 +8.219.97.190 +130.162.244.238 +8.219.107.135 +8.210.43.213 +152.70.61.8 +138.2.107.107 +129.213.202.222 +141.148.231.77 +8.212.41.98 +47.57.233.126 +152.69.199.70 +8.219.190.26 +8.222.253.92 +141.148.232.78 +158.101.215.203 +129.80.45.40 +130.162.33.119 +129.159.30.61 +8.219.97.50 +141.147.39.152 +141.148.233.214 +8.219.56.58 +8.218.178.79 +8.210.207.214 +150.136.1.175 +8.219.177.205 +193.123.34.251 +8.219.171.185 +8.222.216.228 +143.47.189.242 +47.243.5.154 +8.219.1.162 +152.70.214.15 +8.222.160.16 +152.69.179.155 +8.222.155.237 +141.147.85.253 +8.219.49.140 +8.219.68.194 +158.101.222.103 +8.219.249.53 +138.2.24.105 +8.218.98.75 +47.242.174.27 +8.219.40.37 +140.238.158.238 +138.2.173.160 +138.2.5.56 +8.209.45.211 +8.222.168.204 +8.219.175.122 +158.101.221.41 +8.219.165.89 +144.21.34.43 +8.217.72.0 +193.123.178.36 +144.24.160.44 +141.147.24.208 +129.153.146.236 +138.3.253.253 +141.147.183.16 +152.67.154.162 +141.147.9.156 +193.123.176.202 +144.24.176.20 +141.148.229.106 +141.147.15.13 +141.147.47.32 +193.122.54.168 +193.122.1.0 +8.219.77.141 +193.122.12.23 +158.101.207.237 +152.67.203.34 +193.123.39.196 +141.147.94.132 +168.138.184.172 +138.2.191.84 +141.144.199.222 +138.2.190.85 +141.144.243.251 +47.245.110.140 +129.80.177.86 +8.219.173.156 +152.70.57.111 +8.218.81.14 +141.147.184.160 +192.9.250.241 +158.101.206.203 +138.2.167.112 +193.123.180.89 +8.217.154.218 +144.21.42.99 +8.218.65.171 +129.80.167.167 +138.2.2.193 +129.158.50.35 +130.162.249.6 +129.146.7.98 +144.24.165.58 +47.243.137.146 +152.69.224.220 +8.219.137.149 +193.123.56.84 +165.1.79.60 +152.70.189.55 +129.159.251.133 +130.162.213.42 +144.21.36.169 +8.219.228.139 +158.180.76.51 +130.162.166.95 +143.47.190.11 +143.47.229.224 +132.226.6.137 +144.24.70.109 +8.219.182.176 +8.219.238.239 +143.47.178.149 +141.147.96.234 +8.222.217.176 +141.147.104.176 +140.238.218.65 +144.21.62.67 +8.219.214.0 +8.219.83.71 +146.56.182.170 +152.70.52.215 +193.122.125.14 +138.3.249.2 +47.243.206.150 +8.219.49.245 +8.219.181.209 +8.219.214.157 +8.222.230.146 +138.2.64.189 +139.185.34.131 +143.47.249.66 +130.61.169.24 +193.123.39.179 +8.219.237.250 +141.148.225.27 +152.69.195.36 +141.147.110.19 +144.24.171.161 +8.219.114.225 +141.147.1.136 +152.70.49.164 +152.70.59.90 +131.186.27.112 +8.219.236.110 +144.24.200.164 +143.47.234.226 +146.56.149.5 +158.101.208.52 +192.18.134.22 +8.220.135.63 +152.70.53.27 +143.47.246.229 +132.226.214.154 +141.144.201.179 +130.162.158.152 +143.47.245.15 +8.219.3.196 +138.2.156.107 +150.230.20.156 +193.123.56.223 +8.212.12.98 +130.162.233.216 +143.47.239.110 +158.101.206.131 +144.21.36.9 +8.222.65.69 +8.222.244.74 +130.162.58.241 +47.243.169.63 +141.147.99.216 +8.219.120.113 +141.147.75.43 +138.2.106.166 +129.159.30.254 +129.154.205.175 +129.154.50.159 +130.61.197.196 +8.219.64.127 +130.162.253.182 +47.243.139.85 +130.162.248.13 +141.147.42.146 +8.219.70.216 +129.151.104.245 +8.219.250.241 +8.210.140.91 +138.2.178.10 +132.226.7.217 +141.144.224.113 +47.243.255.224 +8.219.199.173 +8.219.111.147 +130.162.221.245 +8.219.13.165 +152.70.49.235 +8.219.89.84 +192.18.159.129 +129.158.46.97 +193.122.48.144 +141.147.37.248 +130.162.208.232 +193.123.188.243 +8.219.113.120 +132.145.8.236 +130.61.107.238 +130.162.33.85 +8.218.108.3 +141.147.66.247 +132.145.87.41 +192.9.157.76 +141.147.147.28 +130.162.163.25 +47.243.234.9 +8.222.244.192 +158.101.221.199 +8.222.151.122 +130.162.216.244 +158.180.68.193 +8.219.108.98 +141.147.33.146 +132.226.235.193 +143.47.177.133 +141.148.235.246 +141.148.224.80 +129.151.204.91 +143.47.178.94 +143.47.179.67 +143.47.178.213 +141.144.197.29 +47.245.105.224 +47.253.161.22 +193.122.119.215 +47.254.65.110 +8.219.98.31 +138.2.163.135 +8.219.163.195 +8.219.99.169 +132.226.163.224 +47.251.95.178 +8.219.85.49 +143.47.230.14 +8.222.215.236 +8.212.14.90 +141.147.111.212 +141.147.95.144 +138.2.162.139 +140.238.60.225 +8.219.167.213 +131.186.63.126 +141.148.235.199 +143.47.176.49 +141.144.193.213 +141.144.231.220 +168.138.149.17 +130.162.138.39 +193.122.97.248 +8.217.22.201 +132.145.94.80 +8.219.161.151 +8.219.189.143 +138.2.61.180 +8.219.160.201 +152.67.96.55 +150.230.125.11 +141.144.200.208 +143.47.243.144 +8.219.125.8 +158.101.201.166 +8.209.45.47 +193.123.228.83 +138.2.138.115 +193.123.37.226 +129.154.202.229 +158.101.212.10 +152.70.52.44 +8.222.132.231 +8.219.251.202 +129.159.11.238 +130.61.23.77 +141.144.199.19 +8.219.8.66 +47.74.155.26 +138.2.153.68 +138.2.56.246 +168.138.177.109 +8.219.220.88 +8.219.49.65 +132.145.15.243 +132.145.152.194 +150.230.221.148 +152.70.249.82 +141.144.230.231 +8.213.150.178 +129.159.44.99 +8.222.229.126 +141.147.5.128 +141.148.237.198 +164.152.34.166 +141.147.21.42 +168.138.46.67 +8.222.214.46 +130.162.169.145 +144.24.169.81 +144.21.34.177 +158.178.238.239 +152.70.234.60 +193.122.15.172 +130.162.229.118 +144.24.185.149 +168.138.141.235 +152.70.207.106 +132.226.16.113 +152.67.148.66 +158.101.201.78 +144.21.57.55 +143.47.191.150 +8.210.164.75 +47.242.36.78 +152.70.52.47 +141.148.238.120 +129.80.166.251 +8.219.154.39 +138.2.146.234 +129.146.60.210 +141.147.95.9 +140.238.201.118 +193.123.162.76 +8.219.254.241 +8.219.7.175 +129.159.251.226 +130.162.161.192 +141.144.192.27 +129.80.177.42 +152.70.60.112 +132.145.54.84 +8.219.234.178 +141.144.207.45 +141.147.30.28 +8.219.10.23 +8.210.58.6 +129.150.42.246 +8.222.150.197 +8.219.89.204 +141.147.6.61 +168.138.13.201 +158.101.206.253 +129.80.174.15 +47.245.102.52 +129.151.225.228 +152.70.58.184 +8.219.160.24 +141.147.147.180 +152.70.59.45 +8.210.110.229 +141.148.232.253 +8.219.132.64 +141.147.61.29 +152.70.45.232 +194.36.24.34 +130.162.53.19 +129.150.51.134 +141.148.224.174 +8.219.173.114 +130.162.218.173 +8.219.229.99 +8.219.104.37 +158.180.230.4 +141.148.237.229 +155.248.176.138 +8.219.202.130 +158.180.71.235 +8.219.200.219 +130.162.237.146 +193.123.59.111 +152.67.159.188 +8.219.220.35 +129.159.221.121 +8.219.153.174 +129.80.48.250 +138.2.135.23 +8.219.229.190 +132.226.133.32 +47.245.118.70 +129.154.59.53 +193.123.56.128 +140.238.9.27 +47.250.149.173 +8.219.190.122 +193.123.62.158 +8.210.32.31 +130.162.191.117 +8.222.180.86 +140.238.58.181 +192.9.137.193 +141.144.228.96 +141.147.95.159 +8.222.169.45 +193.123.58.249 +152.70.253.44 +68.233.121.9 +8.210.250.129 +158.180.82.186 +193.122.58.158 +8.222.154.54 +47.254.17.234 +144.24.85.7 +8.218.181.189 +141.145.205.115 +141.148.229.1 +155.248.196.123 +143.47.238.34 +141.147.106.74 +152.70.188.74 +47.88.15.127 +138.2.143.145 +138.2.135.242 +141.147.57.206 +152.69.232.238 +130.162.208.208 +8.219.84.214 +130.162.246.11 +132.145.53.55 +8.217.50.252 +158.101.206.12 +141.148.228.150 +143.47.240.79 +158.101.219.36 +158.101.192.178 +8.222.167.147 +129.146.240.62 +152.69.210.245 +141.147.64.197 +130.162.56.68 +204.216.104.138 +132.226.114.74 +141.147.90.44 +192.9.180.162 +130.162.173.24 +130.61.201.195 +8.219.100.200 +158.101.215.252 +141.148.166.30 +150.230.156.197 +131.186.31.35 +141.147.92.143 +140.238.212.95 +141.144.196.195 +129.153.116.130 +8.218.1.163 +47.251.33.121 +8.222.254.205 +158.101.214.54 +132.145.246.210 +8.219.102.76 +8.219.177.110 +150.230.121.169 +140.238.7.69 +138.3.240.63 +68.233.127.163 +8.218.228.152 +8.213.137.24 +64.110.101.31 +47.57.245.232 +150.230.181.5 +193.123.189.129 +132.226.14.123 +152.70.110.90 +141.147.163.68 +141.144.204.254 +141.147.23.220 +141.148.151.11 +143.47.189.129 +129.158.198.241 +130.162.189.239 +8.217.123.243 +150.230.122.169 +8.209.37.182 +8.213.237.199 +8.219.92.93 +152.70.49.115 +8.219.139.248 +146.56.162.25 +193.123.34.217 +193.123.182.164 +129.159.132.0 +144.21.34.148 +129.158.208.77 +158.101.202.123 +129.151.148.35 +130.162.172.104 +158.101.211.165 +144.24.164.207 +8.219.171.224 +47.245.126.151 +8.219.87.30 +129.159.69.177 +129.153.23.169 +193.122.13.124 +8.222.247.202 +8.219.183.157 +141.147.97.182 +130.162.214.243 +8.219.0.145 +8.222.182.163 +8.210.63.130 +141.148.160.98 +143.47.187.243 +129.159.84.71 +141.147.7.28 +132.145.116.185 +8.219.247.156 +152.70.57.182 +129.159.129.107 +130.162.216.95 +130.162.212.172 +64.110.79.188 +146.56.47.194 +8.219.127.47 +141.147.117.210 +8.219.98.182 +8.222.211.81 +158.101.202.142 +141.145.216.142 +152.69.230.218 +141.147.17.186 +138.2.24.169 +130.162.173.215 +8.222.156.107 +8.219.239.10 +144.21.39.9 +8.219.167.5 +150.230.117.235 +138.2.36.157 +8.219.13.127 +152.67.139.76 +150.230.21.34 +193.122.49.132 +8.222.226.11 +129.159.241.172 +8.215.39.169 +152.70.59.94 +138.2.176.97 +192.9.236.144 +143.47.186.230 +158.101.209.81 +141.148.225.188 +152.67.190.105 +138.2.160.168 +8.219.55.210 +8.219.143.155 +47.242.183.7 +47.245.120.186 +141.147.91.161 +149.129.8.215 +141.148.241.166 +8.219.138.244 +47.245.84.124 +144.24.74.60 +141.144.252.217 +193.123.80.245 +152.70.166.114 +143.47.251.240 +130.162.52.6 +150.230.22.223 +130.162.160.76 +192.18.130.65 +152.70.52.125 +141.147.96.125 +8.219.191.110 +8.219.155.228 +8.219.130.147 +193.123.34.224 +158.101.210.148 +47.254.171.15 +141.144.195.57 +130.162.189.173 +8.219.240.160 +141.147.53.96 +141.144.243.242 +62.72.163.109 +152.67.159.207 +8.219.182.73 +146.56.143.253 +138.2.160.206 +8.222.222.159 +152.67.251.232 +193.123.35.240 +193.123.252.170 +130.162.223.176 +130.162.167.58 +141.148.7.162 +141.147.73.236 +8.219.220.154 +168.138.194.74 +64.110.72.106 +141.144.224.218 +141.147.82.141 +8.219.221.164 +158.101.199.249 +8.219.144.145 +150.230.20.122 +192.18.134.231 +8.219.109.34 +47.243.70.186 +8.219.11.158 +152.70.60.135 +129.151.254.48 +138.2.5.84 +129.213.130.70 +132.145.91.171 +158.101.221.186 +47.242.107.109 +8.219.212.76 +130.162.169.236 +47.242.121.232 +146.56.159.251 +141.147.117.157 +141.148.247.178 +138.3.253.128 +8.222.167.223 +141.148.236.49 +131.186.40.54 +8.222.194.249 +8.222.156.242 +144.24.95.245 +193.123.189.247 +143.47.234.135 +8.218.202.1 +8.222.133.247 +8.222.144.50 +91.149.239.122 +47.242.42.153 +8.219.153.237 +130.162.58.205 +47.243.35.200 +8.218.142.253 +8.222.215.182 +141.147.101.140 +141.147.172.38 +152.67.156.114 +141.144.255.195 +8.218.183.231 +141.148.243.175 +8.219.170.170 +141.144.200.124 +138.2.160.176 +8.219.13.77 +8.219.166.29 +8.219.114.201 +8.219.85.141 +8.219.148.90 +8.222.145.199 +144.24.79.192 +152.70.53.165 +8.219.157.145 +129.154.207.65 +132.226.228.119 +129.146.33.223 +8.219.139.13 +141.148.147.214 +8.218.120.79 +193.123.190.58 +8.222.146.136 +47.90.141.204 +8.219.180.188 +130.162.148.92 +8.219.196.46 +8.217.66.3 +8.222.216.36 +8.220.198.90 +8.222.228.86 +129.154.46.115 +138.2.125.230 +144.21.57.191 +192.9.177.204 +144.21.33.26 +141.144.196.101 +8.219.97.88 +141.144.252.252 +130.162.226.150 +8.219.59.150 +141.144.253.109 +141.145.199.188 +8.219.97.93 +158.101.202.127 +144.21.36.229 +132.226.168.115 +141.144.254.148 +8.220.135.231 +158.180.94.167 +144.21.56.223 +130.162.213.95 +138.2.188.184 +8.219.209.91 +143.47.250.127 +193.122.125.223 +150.230.215.34 +8.210.203.7 +8.219.179.112 +152.70.192.193 +192.18.148.248 +8.222.219.52 +8.218.26.21 +193.123.59.156 +8.222.145.43 +168.138.90.241 +8.219.174.142 +168.138.197.97 +141.147.6.32 +130.162.61.18 +141.148.224.220 +158.101.203.222 +152.67.133.84 +8.219.162.235 +8.210.34.188 +138.2.146.198 +130.162.59.114 +8.222.179.231 +141.147.28.187 +64.110.104.30 +8.222.187.196 +141.144.200.49 +154.23.240.232 +47.242.123.166 +144.22.252.124 +8.218.136.25 +193.123.35.191 +138.2.114.110 +140.238.173.181 +158.101.211.77 +144.21.36.22 +150.230.146.170 +129.151.198.3 +158.101.210.88 +8.212.65.162 +132.226.15.222 +8.219.113.232 +152.70.123.225 +158.101.208.160 +131.186.63.171 +8.219.251.108 +144.21.34.247 +193.122.11.194 +152.67.203.46 +138.3.223.174 +8.210.55.134 +8.219.249.182 +141.147.185.63 +8.219.147.198 +129.154.207.203 +8.219.159.195 +152.70.61.211 +152.70.185.175 +141.147.82.167 +130.61.204.3 +47.253.192.14 +158.180.81.153 +152.70.252.133 +144.24.81.41 +8.210.233.168 +138.3.210.24 +141.147.175.120 +193.123.69.77 +8.219.74.101 +144.21.42.208 +8.222.215.188 +47.242.21.91 +158.101.210.188 +8.219.10.203 +8.219.178.65 +8.218.53.110 +47.242.218.87 +140.83.33.103 +47.243.60.150 +8.222.131.79 +165.1.76.23 +141.147.165.93 +8.218.92.195 +152.67.192.41 +8.219.6.150 +138.2.75.91 +168.138.175.69 +141.147.42.209 +193.123.63.186 +129.159.143.171 +143.47.231.18 +8.219.143.99 +141.148.244.82 +144.24.90.107 +131.186.22.106 +141.148.220.141 +8.219.228.131 +158.101.221.144 +8.219.206.0 +132.226.128.197 +130.162.171.79 +8.219.123.11 +152.67.130.49 +8.210.126.88 +144.21.32.165 +150.230.42.80 +164.152.17.14 +8.222.156.152 +144.24.65.221 +158.101.209.113 +141.148.237.191 +141.148.240.72 +8.222.172.92 +158.101.223.78 +129.146.243.241 +8.222.191.138 +141.148.187.195 +143.47.229.18 +141.147.82.240 +8.222.164.139 +193.123.56.127 +158.101.219.6 +155.248.181.189 +141.144.204.246 +138.2.122.191 +168.138.212.80 +132.226.236.61 +130.162.176.125 +158.101.220.201 +140.238.126.209 +141.144.202.132 +144.21.37.151 +152.70.96.216 +129.153.174.153 +141.147.92.171 +8.219.179.220 +143.47.230.32 +193.123.81.105 +47.245.81.142 +8.219.10.140 +8.219.1.169 +8.219.114.166 +150.230.196.41 +141.148.227.175 +141.148.216.47 +8.219.213.199 +8.210.100.23 +150.230.108.100 +8.219.152.58 +8.217.232.246 +199.59.243.228 +8.218.143.10 +8.222.68.116 +91.195.240.12 +141.147.96.24 +158.180.231.216 +144.24.191.201 +193.123.39.86 +141.147.70.161 +129.80.154.195 +141.148.14.241 +129.80.147.122 +8.210.42.171 +47.89.244.253 +132.226.44.239 +132.145.246.197 +130.162.216.169 +47.253.105.131 +158.180.92.59 +138.2.31.192 +8.219.100.168 +141.147.3.166 +129.159.12.73 +8.219.109.58 +141.147.68.21 +129.146.111.62 +8.212.44.95 +141.148.245.51 +8.219.86.200 +8.219.186.120 +141.148.231.92 +8.222.161.207 +8.210.244.38 +150.230.120.5 +152.70.60.114 +8.219.185.47 +144.24.73.232 +152.70.202.26 +141.147.61.116 +141.144.206.211 +8.209.37.117 +47.243.186.171 +141.147.82.151 +129.146.46.164 +129.213.136.180 +129.153.159.143 +141.147.79.123 +130.162.210.203 +132.226.21.3 +141.147.74.26 +144.24.53.45 +47.250.135.126 +131.186.25.156 +8.218.3.12 +138.2.179.142 +141.147.85.167 +8.219.110.248 +131.186.28.107 +47.242.157.96 +152.70.155.147 +8.222.147.254 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a5ec562 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +# 示例 requirements.txt +requests +PySocks +telethon \ No newline at end of file diff --git a/speed/fd.txt b/speed/fd.txt new file mode 100644 index 0000000..e69de29 diff --git a/speed/ip.txt b/speed/ip.txt new file mode 100644 index 0000000..05d07c4 --- /dev/null +++ b/speed/ip.txt @@ -0,0 +1,4 @@ +172.67.175.49:443#🇺🇸SEA┃CF优选┃⚡239.99(MB/s) +104.17.224.119:443#🇺🇸SEA┃CF优选┃⚡178.56(MB/s) +172.67.160.9:443#🇺🇸SEA┃CF优选┃⚡119.61(MB/s) +172.67.170.6:443#🇺🇸SEA┃CF优选┃⚡91.00(MB/s) diff --git a/speed/ipv6.txt b/speed/ipv6.txt new file mode 100644 index 0000000..f5896a5 --- /dev/null +++ b/speed/ipv6.txt @@ -0,0 +1,17 @@ +[2606:4700:f4:52:47b5:8b11:d97c:9f05]:2087#🇭🇰HKG┃IPV6┃⚡519.17(MB/s) +[2606:4700:a8:c7:9b27:433e:9914:6013]:2087#🇭🇰HKG┃IPV6┃⚡508.59(MB/s) +[2606:4700:3037:729d:9966:5391:4935:7d2c]:2087#🇭🇰HKG┃IPV6┃⚡457.94(MB/s) +[2606:4700:f4:52:9a55:17c0:370c:b77]:2087#🇭🇰HKG┃IPV6┃⚡449.03(MB/s) +[2606:4700:3036:ed9:830b:d75f:5c05:53aa]:2087#🇭🇰HKG┃IPV6┃⚡423.92(MB/s) +[2606:4700:3032:b022:1982:fc07:7fa6:5ffc]:2087#🇭🇰HKG┃IPV6┃⚡415.34(MB/s) +[2606:4700:3037:0:e2b7:1a07:1528:5ca5]:2087#🇭🇰HKG┃IPV6┃⚡389.86(MB/s) +[2606:4700:3032:50:89ed:9d4c:1cb5:4400]:2087#🇭🇰HKG┃IPV6┃⚡383.05(MB/s) +[2606:4700:3033:7c3b:79b8:94da:5076:90ab]:2087#🇭🇰HKG┃IPV6┃⚡382.38(MB/s) +[2606:4700:3034:ca6f:a064:d81d:54a4:6cf]:2087#🇭🇰HKG┃IPV6┃⚡314.58(MB/s) +[2606:4700:3036:ed9:830b:d714:8f77:da2]:2087#🇭🇰HKG┃IPV6┃⚡277.44(MB/s) +[2606:4700:f4:b4a7:e56b:b6d5:bda9:c602]:2087#🇭🇰HKG┃IPV6┃⚡262.09(MB/s) +[2a06:98c1:3121:0:ac63:ae5c:b347:5bfb]:2087#🇭🇰HKG┃IPV6┃⚡391.39(MB/s) +[2606:4700:f4:0:7993:cea4:ecb1:bca2]:2087#🇭🇰HKG┃IPV6┃⚡319.29(MB/s) +[2606:4700:a0:f5db:abee:a6db:d80b:5a6b]:2087#🇭🇰HKG┃IPV6┃⚡313.53(MB/s) +[2606:4700:a0:f5db:fe6d:1cb1:8ced:550b]:2087#🇭🇰HKG┃IPV6┃⚡277.87(MB/s) +[2606:4700:a0:f5db:abee:80e0:770b:63c9]:2087#🇭🇰HKG┃IPV6┃⚡252.14(MB/s) \ No newline at end of file diff --git a/tg.py b/tg.py new file mode 100644 index 0000000..0a557da --- /dev/null +++ b/tg.py @@ -0,0 +1,190 @@ +import logging +import re +import csv +import subprocess +import sys +from pathlib import Path +from telethon.sync import TelegramClient +from telethon.tl.types import DocumentAttributeFilename +import socks +from colo_emojis import colo_emojis # 导入数据中心emoji映射 +from checker import process_ip_list + +# -------------------------- +# 配置区(根据实际情况修改) +# -------------------------- +API_ID = 23453508 +API_HASH = '11cbe8c19746ebf88db5ad991c5508b5' +CHANNEL = '@cloudflareorg' +LIMIT = 10 +DOWNLOAD_DIR = 'csv' +OUTPUT_FILE = 'cfip/cfip.txt' +LOG_FILE= 'log/cfiplog.txt' +Path(DOWNLOAD_DIR).mkdir(exist_ok=True) +Path("cfip").mkdir(exist_ok=True) + +# 代理配置(可选) +PROXY_TYPE = 'socks5' +PROXY_HOST = '' +PROXY_PORT = '' +PROXY_USER = '' +PROXY_PASS = '' + +logging.basicConfig( + format='%(asctime)s - %(levelname)s: %(message)s', + level=logging.INFO +) +logger = logging.getLogger(__name__) + +def delete_old_csv_files(): + """删除所有 45102*.csv 文件""" + csv_files = Path(DOWNLOAD_DIR).glob("45102*.csv") + for file in csv_files: + try: + file.unlink() + logger.info(f"已删除旧文件: {file}") + except Exception as e: + logger.error(f"删除文件失败: {file} - {e}") + +def is_target_file(filename: str) -> bool: + """检查是否是 45102 开头的 CSV 文件""" + return bool(re.match(r'^45102.*\.csv$', filename, re.IGNORECASE)) if filename else False + +def get_proxy_config(): + if not PROXY_TYPE or not PROXY_HOST: + return None + + proxy_map = { + 'socks5': socks.SOCKS5, + 'http': socks.HTTP + } + if PROXY_TYPE not in proxy_map: + raise ValueError(f"不支持的代理类型: {PROXY_TYPE}") + + return ( + proxy_map[PROXY_TYPE], + PROXY_HOST, + PROXY_PORT, + True, + PROXY_USER if PROXY_USER else None, + PROXY_PASS if PROXY_PASS else None + ) + +def extract_data_from_csv(csv_file): + """解析 CSV 文件并格式化数据""" + extracted_data = [] + + with open(csv_file, newline='', encoding='utf-8-sig') as f: + reader = csv.DictReader(f) + # 打印表头,检查 CSV 文件的字段名是否正确 + logger.info(f"CSV 表头: {reader.fieldnames}") + + for row in reader: + try: + logger.info(f"读取的行: {row}") # 打印每一行的数据 + + ip = row.get('IP地址', '').strip() + port = row.get('端口', '443').strip() + colo_code = row.get('数据中心', '').strip() + speed = row.get('下载速度', '未知').strip() + + if not ip or not colo_code: + continue # 跳过无效行 + + # 获取数据中心对应的emoji + emoji = colo_emojis.get(colo_code, '') + # 格式化数据行 + data_line = f"{ip}:{port}#{emoji}{colo_code}┃CF优选" + extracted_data.append(data_line) + logger.info(data_line) # 打印到终端 + + except Exception as e: + logger.error(f"解析 CSV 行失败: {e}") + + return extracted_data + +def save_results(data, output_file): + """保存提取结果到文件""" + with open(output_file, 'w', encoding='utf-8') as f: + f.write("\n".join(data)) + logger.info(f"提取数据已保存到: {output_file}") + +def git_commit_and_push(commit_message="Update CSV file"): + """执行 git commit 和 push 操作""" + try: + subprocess.run(["git", "add", "."], check=True) + subprocess.run(["git", "commit", "-m", commit_message], check=True) + subprocess.run(["git", "push", "-u", "origin", "main"], check=True) + logger.info("已将文件上传到 GitHub 仓库。") + except subprocess.CalledProcessError as e: + logger.error(f"Git 操作失败: {e}") + sys.exit(1) + +def main(): + delete_old_csv_files() + + proxy = get_proxy_config() + + with TelegramClient('session_name', API_ID, API_HASH, proxy=proxy) as client: + try: + channel = client.get_entity(CHANNEL) + logger.info(f"成功连接频道: {channel.title}") + + file_found = False + + for message in client.iter_messages(channel, limit=LIMIT): + try: + if not (message.media and message.document): + continue + + filename = next( + (attr.file_name for attr in message.document.attributes + if isinstance(attr, DocumentAttributeFilename)), + None + ) + + if not is_target_file(filename): + continue + + save_path = Path(DOWNLOAD_DIR) / filename + + if save_path.exists(): + logger.warning(f"文件已存在,跳过: {filename}") + continue + + logger.info(f"发现最新文件: {filename}") + client.download_media( + message, + file=save_path, + progress_callback=lambda cur, tot: logger.info( + f"下载进度: {cur/tot:.1%} - {filename}" + ) + ) + logger.info(f"文件已保存到: {save_path}") + file_found = True + + # 解析 CSV 并保存结果 + extracted_data = extract_data_from_csv(save_path) + save_results(extracted_data, OUTPUT_FILE) + + break # 下载完成后立即中断循环 + + except Exception as e: + logger.error(f"处理消息 {message.id} 失败: {str(e)}") + continue + + if not file_found: + logger.warning(f"前 {LIMIT} 条消息中未找到符合条件的文件,请尝试增大 LIMIT 值") + + except Exception as e: + logger.error(f"程序运行失败: {str(e)}") + raise + + # 删除不可达的 IP + process_ip_list(OUTPUT_FILE,LOG_FILE) + + # Git 上传步骤 + git_commit_and_push("自动更新文件") + +if __name__ == '__main__': + main() \ No newline at end of file