generate_en_domain.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2023/03/08 20:18:13
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : 批量生成域名(双拼,双单词,双单词拼接)
  8. 参考项目: https://git.yoqi.me/lyq/SearchDomain
  9. '''
  10. import csv
  11. class GenerateEnDomain(object):
  12. def __init__(self):
  13. '''初始化列表'''
  14. self.initList=[]
  15. # self.keyword=["chat","ai"] # chat+xx
  16. self.keyword=["gpt"] # xx + ai
  17. self.composePinYin=[]
  18. # self.yuming=["com","cn","me","net"]
  19. self.yuming=["cn"]
  20. self.composeDomain=[]
  21. def run(self):
  22. with open(("res3.csv"), "r", encoding="utf-8") as f:
  23. csv_data = f.readlines()
  24. for row in csv_data:
  25. self.initList.append(row.strip())
  26. for i in self.initList:
  27. for j in self.keyword:
  28. self.composePinYin.append(i+j)
  29. # self.composePinYin.append(j+i)
  30. for i in self.composePinYin:
  31. for j in self.yuming:
  32. self.composeDomain.append(i+"."+j)
  33. with open("domain.txt","w",encoding="utf-8") as file:
  34. for i in self.composeDomain:
  35. file.write(i+"\n")