{"id":18273197,"url":"https://github.com/goodcoder666/gtdb","last_synced_at":"2025-04-05T02:31:12.589Z","repository":{"id":250280497,"uuid":"807605988","full_name":"GoodCoder666/gtdb","owner":"GoodCoder666","description":"谷歌翻译 IP 数据库 \u0026 扫描脚本","archived":false,"fork":false,"pushed_at":"2024-10-18T14:18:22.000Z","size":145,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T21:18:48.513Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodCoder666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-29T12:27:16.000Z","updated_at":"2025-03-03T03:20:25.000Z","dependencies_parsed_at":"2024-07-26T09:42:59.054Z","dependency_job_id":null,"html_url":"https://github.com/GoodCoder666/gtdb","commit_stats":null,"previous_names":["goodcoder666/gtdb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fgtdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fgtdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fgtdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodCoder666%2Fgtdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodCoder666","download_url":"https://codeload.github.com/GoodCoder666/gtdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247279394,"owners_count":20912877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T12:05:33.761Z","updated_at":"2025-04-05T02:31:12.021Z","avatar_url":"https://github.com/GoodCoder666.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gtdb\n\n[GoogleTranslate_IPFinder](https://github.com/GoodCoder666/GoogleTranslate_IPFinder) 的官方 IP 库及更新脚本。\n\n\u003e 2024/10/18：更新超级 IP 库，从 [GotoX IP](https://github.com/SeaHOH/GotoX/blob/master/data/ip.txt) 分离出了 IPv4 和 IPv6。当默认 IP 库全部无效时，建议尝试此 IP 库（IPv4 优先）。\n\n## 项目结构\n\n```\n│  .gitignore       Git ignore 源文件\n│  LICENSE          GPL-3.0 版权许可\n│  README.md        本文件\n│\n├─ full             超级 IP 库\n│  │  v4.txt        IPv4 库\n│  │  v6.txt        IPv6 库\n├─ src\n|  非代码文件\n│  │  ip.txt        IP 数据库\n│  │  config.ini    配置文件\n|  代码文件\n│  │  config.py     配置文件处理模块\n│  │  database.py   数据库接口\n│  │  gtdb.py       主程序入口\n│  │  scanner.py    扫描模块\n│  │  utils.py      网络接口\n\n** 把 ip.txt 和 config.ini 放在 src 目录下是为了方便运行。\n```\n\n## 运行脚本\n\n在安装了 Python \u003e= 3.6 的任意系统中执行 `gtdb.py` 即可。\n\n若配置了 `progressBar = true`（使用进度条）则需要 `tqdm` 模块：\n\n```\npip3 install tqdm\n```\n\n否则无第三方依赖项。\n\n## 配置文件\n\n运行脚本需要同一目录下存在正确的配置文件 `config.ini`。下面解释其中的一些参数：\n\n- section `[logging]`\n\n  - `silent`: 是否禁用控制台日志。如果你需要定时自动执行脚本，可以使用 `silent = true`。默认值：`false`\n  - `updateInterval`: 更新间隔。每隔设定的时间更新一次控制台日志，单位为秒（s）。默认值：`2.0`\n  - `progressBar`: 是否使用进度条代替日志输出。如果设置为 `true`，则需要安装 `tqdm` 模块。默认值：`false`\n\n- section `[scan]`\n\n  - `numThreads`: 扫描使用的线程数。**请根据硬件配置情况调整**，过大可能导致程序无法正常执行。默认值：`64`\n  - `timeout`: 请求时间限制，单位为秒（s）。若目标 IP 超出此时间为响应，则自动判定为不可用。默认值：`1.5`\n  - `randomize`: 是否随机化扫描。默认值：`true`\n  - `resultLimit`: 结果数量限制。当扫出的 IP 数量达到限制时，停止扫描并保存结果。设置为 `0` 则表示无限制。默认值：`0`\n  - `stabilityThreshold`: 稳定性阈值。指定单个 IP 判定为可用前的测试次数。默认值：3\n  - `host`: 扫描域名，一般不需要修改。默认值：`translate.googleapis.com`\n  - `format`: 请求模板，一般不需要修改。默认值：`https://{}/translate_a/single?client=gtx\u0026sl=en\u0026tl=fr\u0026q=a`\n  - `ipRanges`: 扫描使用的 IP 段，可以设置多个。默认值：`142.250.0.0/15`\n\n- section `[database]`\n\n  - `dbfile`: 数据库文件名。默认值：`ip.txt`\n  - `saveMode`: 保存模式，可选 `append` / `overwrite`。分别表示在原有基础上添加数据或完全覆盖原有数据库。注意数据保存时会自动按字典序排序。\n\n## CONTRIBUTING\n\n我们希望能为不同网络环境的用户提供统一 IP 库。由于作者本人资源有限，无法做到在所有地区、网络、运营商分别进行 IP 扫描。\n\n欢迎贡献可用的 IP。请先 clone 原有的 IP 库，**不要修改除 `numThreads` 和 `[logging]` 以外的其他配置项**，直接运行 `gtdb.py` 来完成 IP 库的更新。\n\n更新之后提交 Pull Request，分支命名为 `update-yyyyMMdd`（即 `update` 加上更新的时间，如 `update-20240726`）。**您的 PR 不应包含对 `ip.txt` 以外文件的修改。**建议在评论区备注自己所在地区以及运营商方便验证。感谢您对此项目的支持！\n\n\u003e [!TIP]\n\u003e\n\u003e 如果你是在对代码/其他文件做改进，直接无视上面的内容。随便 PR。欢迎！","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodcoder666%2Fgtdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodcoder666%2Fgtdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodcoder666%2Fgtdb/lists"}