单次运行不够,DNS 返回的 IP 不一致,需按 5 分钟间隔反复运行上百次才较完整;shell 脚本依赖 dig、sort、grep、parallel、aria2c,需先 apt 安装;项目自述为 STABLE BETA,列表可能不全
pip3 install -r requirements.txt
python3 src/list_generator.pyREADME 未说明,脚本只做 DNS 查询与文本处理,普通机器即可运行
通过 DNS 查询持续收集 YouTube 使用的 IPv4/IPv6 地址,并自动生成可下载的 IP 列表
汇总 YouTube 全部 IPv4/IPv6 地址段,生成可直接用于 DNS 或路由器的屏蔽列表,方便做广告拦截和隐私防护。
核心能力
- 用 DNS 查询收集 YouTube 的 IPv4 与 IPv6 地址
- 约每 5 分钟自动更新列表,当前收录 34659 个 IP
- 提供 ipv4、ipv6、cidr4、cidr6 纯文本列表
- 额外生成 RouterOS 的 .rsc 配置脚本
- 附带 shell 与 Python 脚本,可自行重复生成列表
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
iplist-youtube
An attempt to list all IPs that YouTube uses.
This list attempts to keep all ipv4 and ipv6 addresses used by YouTube. We use DNS Lookups to achieve this and the lists are automatically updated approximately every 5 minutes. The project is currently STABLE BETA. So, not all IPs might be available. At present, it has a collection of 34659 YouTube IPs.
Lists
- ipv4.txt
- ipv6.txt
- cidr4.txt
- cidr6.txt
- routeros.rsc NEW!
- routerosv4.rsc NEW!
- routerosv6.rsc NEW!
Used open source lists:
How to make the lists manually.
There are two scripts in the repository root, list_generator.sh and list_generator.py.
Running any of these scripts should generate two files with a list of IPv4 and IPv6 addresses with the filenames lists/ipv4.txt and lists/ipv6.txt.
Note that the list_generator.py is recommended although list_generator.sh should run better.
This is because the list_generator.sh uses an underlining tool called dig which is a troubleshooting tool not intended to be used for production purposes.
It has a little chance of listing some wrong IPs In some cases.
With a warning or error.
To use the list_generator.sh file run these commands in the folder containing the files.
chmod +x src/list_generator.sh
./src/list_generator.sh
If this doesn't work, run the following before using it. It should only be necessary once.
sudo apt install sort dig grep parallel aria2c
For the .py file, you need to install dependencies.
This is only necessary once.
pip3 install -r requirements.txt
Then run:
chmod +x src/list_generator.py
./src/list_generator.py
If this doesn't work, try:
python3 src/list_generator.py
New! To generate CIDR lists use generate_cidr.py
python3 src/generate_cidr.py
Important Notes
Using any of these scripts once is not enough. This is because IPs returned by DNS Queries are not consistent. They are changed at fixed or unfixed intervals. Although all IPs are not returned at the same time, all have the same purpose. And different computers use different IPs at the same time. And so, running the scripts, again and again, is a necessity. If you run the scripts more IPs should be automatic. Personally recommend running the scripts at least 100 times at the interval of 5 minutes or 300 seconds (Google's TTL). For reasonable performance, run it 1000 times before using it for production. I use such Cron jobs to populate the lists.
*/5 * * * * /path/to/the/script