From ac392a03ae3d193112fdb0093f1aa70765fe5d86 Mon Sep 17 00:00:00 2001 From: mcz Date: Fri, 9 Aug 2024 09:42:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipdb.txt | 6 ++--- ipdb_2024-08-09-09-41-39.txt | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 ipdb_2024-08-09-09-41-39.txt diff --git a/ipdb.txt b/ipdb.txt index d8c6aff..6393cf3 100644 --- a/ipdb.txt +++ b/ipdb.txt @@ -43,9 +43,9 @@ 211.90.146.0/23 211.93.170.0/24 220.248.203.0/24 +221.0.30.0/24 221.6.171.0/24 221.7.251.0/24 -221.0.30.0/24 -221.205.168.0/24 +221.205.168.0/23 222.125.57.0/24 -222.189.163.0/24 +222.189.163.0/24 \ No newline at end of file diff --git a/ipdb_2024-08-09-09-41-39.txt b/ipdb_2024-08-09-09-41-39.txt new file mode 100644 index 0000000..d8c6aff --- /dev/null +++ b/ipdb_2024-08-09-09-41-39.txt @@ -0,0 +1,51 @@ +# IP段清单 +27.221.70.0/24 +36.5.81.0/24 +36.35.38.0/24 +36.134.76.0/24 +36.151.55.0/24 +36.249.150.0/24 +39.74.239.0/24 +42.48.90.0/24 +49.86.47.0/24 +58.220.40.0/24 +60.190.128.0/24 +60.220.182.0/24 +60.221.195.0/24 +60.221.231.0/24 +61.146.45.0/24 +61.147.95.0/24 +61.160.233.0/24 +61.160.239.0/24 +61.179.15.0/24 +61.241.177.0/24 +106.6.215.0/24 +111.121.27.0/24 +113.231.202.0/24 +114.230.220.0/24 +116.179.152.0/24 +116.246.1.0/24 +118.81.184.0/23 +122.195.22.0/24 +123.6.49.0/24 +124.132.156.0/24 +124.163.207.0/23 +124.163.220.0/24 +153.99.251.0/24 +153.101.51.0/24 +153.101.64.0/23 +153.101.141.0/24 +175.42.154.0/23 +175.44.72.0/23 +183.185.14.0/24 +183.222.140.0/23 +183.224.221.0/24 +211.90.146.0/23 +211.93.170.0/24 +220.248.203.0/24 +221.6.171.0/24 +221.7.251.0/24 +221.0.30.0/24 +221.205.168.0/24 +222.125.57.0/24 +222.189.163.0/24 From 1ad185c72fabae610ed811598485b3408aa9dea9 Mon Sep 17 00:00:00 2001 From: mcz Date: Fri, 9 Aug 2024 09:46:20 +0800 Subject: [PATCH 2/4] delete --- ipdb_2024-08-09-09-41-39.txt | 51 ------------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 ipdb_2024-08-09-09-41-39.txt diff --git a/ipdb_2024-08-09-09-41-39.txt b/ipdb_2024-08-09-09-41-39.txt deleted file mode 100644 index d8c6aff..0000000 --- a/ipdb_2024-08-09-09-41-39.txt +++ /dev/null @@ -1,51 +0,0 @@ -# IP段清单 -27.221.70.0/24 -36.5.81.0/24 -36.35.38.0/24 -36.134.76.0/24 -36.151.55.0/24 -36.249.150.0/24 -39.74.239.0/24 -42.48.90.0/24 -49.86.47.0/24 -58.220.40.0/24 -60.190.128.0/24 -60.220.182.0/24 -60.221.195.0/24 -60.221.231.0/24 -61.146.45.0/24 -61.147.95.0/24 -61.160.233.0/24 -61.160.239.0/24 -61.179.15.0/24 -61.241.177.0/24 -106.6.215.0/24 -111.121.27.0/24 -113.231.202.0/24 -114.230.220.0/24 -116.179.152.0/24 -116.246.1.0/24 -118.81.184.0/23 -122.195.22.0/24 -123.6.49.0/24 -124.132.156.0/24 -124.163.207.0/23 -124.163.220.0/24 -153.99.251.0/24 -153.101.51.0/24 -153.101.64.0/23 -153.101.141.0/24 -175.42.154.0/23 -175.44.72.0/23 -183.185.14.0/24 -183.222.140.0/23 -183.224.221.0/24 -211.90.146.0/23 -211.93.170.0/24 -220.248.203.0/24 -221.6.171.0/24 -221.7.251.0/24 -221.0.30.0/24 -221.205.168.0/24 -222.125.57.0/24 -222.189.163.0/24 From 8bb3edc89dc2f6c4401d0e8ce601c2cd8aaa1e37 Mon Sep 17 00:00:00 2001 From: mcz Date: Fri, 9 Aug 2024 10:14:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96&?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipdb.txt | 1 + main.py | 57 +++++++++++++++++++++++++++++++------------------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ipdb.txt b/ipdb.txt index 6393cf3..d6208a6 100644 --- a/ipdb.txt +++ b/ipdb.txt @@ -47,5 +47,6 @@ 221.6.171.0/24 221.7.251.0/24 221.205.168.0/23 +222.94.227.0/24 222.125.57.0/24 222.189.163.0/24 \ No newline at end of file diff --git a/main.py b/main.py index 8b2a29a..034e40c 100644 --- a/main.py +++ b/main.py @@ -3,29 +3,36 @@ # 将ipdb.txt备份为ipdb_日期_时间.txt 格式 import datetime -date = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S') -with open('ipdb.txt', 'r') as f: - lines = f.readlines() - with open(f'ipdb_{date}.txt', 'w') as f: - f.write(''.join(lines)) - print('备份完成!') +def main(filename='ipdb.txt'): + date = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S') + with open(filename, 'r') as f: + lines = f.readlines() + print(f"{filename.split('.')[0]}_{date}.txt") + with open(f"{filename.split('.')[0]}_{date}.txt", 'w') as f: + f.write(''.join(lines)) + print('备份完成!') -with open('ipdb.txt', 'r') as f: - # 读取内容,并将每行的数据进行排序 - lines = f.readlines() - lines_without_newlines = [line.strip() for line in lines] - # 对lines_without_newlines进行去重 - lines_without_newlines = list(set(lines_without_newlines)) - # 剔除lines_without_newlines中空的元素和#开头的元素 - lines_without_newlines = [line for line in lines_without_newlines if line and not line.startswith('#')] - # 将ip清单中的每个ip地址按照点分十进制进行排序 - lines_without_newlines.sort(key=lambda x: tuple(map(int, x.split('/')[0].split('.')))) - # 在lines_without_newlines开头插入新元素 - lines_without_newlines.insert(0, '# IP段清单') - print(lines_without_newlines) - # 打印lines_without_newlines的长度 - print(len(lines_without_newlines)) - # 将排序后的内容写入文件,要求每个元素一行 - with open('ipdb.txt', 'w') as f: - f.write('\n'.join(lines_without_newlines)) - print('排序完成,更新完成!') + with open(filename, 'r') as f: + # 读取内容,并将每行的数据进行排序 + lines = f.readlines() + lines_without_newlines = [line.strip() for line in lines] + # 对lines_without_newlines进行去重 + lines_without_newlines = list(set(lines_without_newlines)) + # 剔除lines_without_newlines中空的元素和#开头的元素 + lines_without_newlines = [line for line in lines_without_newlines if line and not line.startswith('#')] + # 将ip清单中的每个ip地址按照点分十进制进行排序 + lines_without_newlines.sort(key=lambda x: tuple(map(int, x.split('/')[0].split('.')))) + # 在lines_without_newlines开头插入新元素 + lines_without_newlines.insert(0, '# IP段清单') + print(lines_without_newlines) + # 打印lines_without_newlines的长度 + print(len(lines_without_newlines)) + # 将排序后的内容写入文件,要求每个元素一行 + with open(filename, 'w') as f: + f.write('\n'.join(lines_without_newlines)) + print('排序完成,更新完成!') + + + +if __name__ == '__main__': + main() \ No newline at end of file From a68a9564b1e8091029cbc5680a3453ef098da86c Mon Sep 17 00:00:00 2001 From: mcz Date: Fri, 9 Aug 2024 10:41:18 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d72e755..7475b85 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,13 @@ ipdb.txt文件,已经排序。 ## 关于补充ip数据 如果有补充的地址,大家可以在 ipdb.txt 里直接增加 ip 段,然后提交上来,目前非常依赖用户贡献新的地址段。 +### 要求 +为避免误伤正常IP,大家提pr或者issue同时,需要提供自己CDN被刷的截图或者可靠来源链接,方便验证。 -## 情况介绍部分链接: +## 情况介绍部分链接 +### v2ex https://www.v2ex.com/t/1056361 https://www.v2ex.com/t/1055550 @@ -30,8 +33,8 @@ https://www.v2ex.com/t/1052331 https://www.v2ex.com/t/1045318 -https://mp.weixin.qq.com/s/cl_ZAZ1PpP1NIT1UXa7PeQ - +### 多吉云公告 https://www.dogecloud.com/announcement/26 +### 其他 https://linux.do/t/topic/169770