Merge branch 'unclemcz:main' into dev
This commit is contained in:
commit
634f7a4a90
|
|
@ -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
|
||||
|
|
|
|||
5
ipdb.txt
5
ipdb.txt
|
|
@ -43,9 +43,10 @@
|
|||
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.94.227.0/24
|
||||
222.125.57.0/24
|
||||
222.189.163.0/24
|
||||
17
main.py
17
main.py
|
|
@ -3,14 +3,16 @@
|
|||
# 将ipdb.txt备份为ipdb_日期_时间.txt 格式
|
||||
import datetime
|
||||
|
||||
date = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')
|
||||
with open('ipdb.txt', 'r') as f:
|
||||
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()
|
||||
with open(f'ipdb_{date}.txt', 'w') as f:
|
||||
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:
|
||||
with open(filename, 'r') as f:
|
||||
# 读取内容,并将每行的数据进行排序
|
||||
lines = f.readlines()
|
||||
lines_without_newlines = [line.strip() for line in lines]
|
||||
|
|
@ -26,6 +28,11 @@ with open('ipdb.txt', 'r') as f:
|
|||
# 打印lines_without_newlines的长度
|
||||
print(len(lines_without_newlines))
|
||||
# 将排序后的内容写入文件,要求每个元素一行
|
||||
with open('ipdb.txt', 'w') as f:
|
||||
with open(filename, 'w') as f:
|
||||
f.write('\n'.join(lines_without_newlines))
|
||||
print('排序完成,更新完成!')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Reference in New Issue