itv(request).py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. import time
  2. import os
  3. import concurrent.futures
  4. from selenium import webdriver
  5. from selenium.webdriver.chrome.options import Options
  6. import requests
  7. import re
  8. urls = [
  9. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmVpamluZyI=", # 北京
  10. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hhbmdoYWki", # 上海
  11. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0idGlhbmppbiI=", # 天津
  12. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hvbmdxaW5nIg==", # 重庆
  13. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYW5xaW5nIg==", # 安庆
  14. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYW5zaGFuIg==", # 鞍山
  15. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYW55YW5nIg==", # 安阳
  16. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmFpY2hlbmci", # 白城
  17. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmFvZGluZyI=", # 保定
  18. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmFvamki", # 宝鸡
  19. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmluemhvdSI=", # 滨州
  20. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYm96aG91Ig==", # 亳州
  21. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2FuZ3pob3Ui", # 沧州
  22. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hhbmdkZSI=", # 常德
  23. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hhb3pob3Ui", # 潮州
  24. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hlbmdkdSI=", # 成都
  25. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hlbnpob3Ui", # 郴州
  26. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hpemhvdSI=", # 池州
  27. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hvbmd6dW8i", # 崇左
  28. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2h1emhvdSI=", # 滁州
  29. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGFsaSI=", # 大理
  30. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGFueWFuZyI=", # 丹阳
  31. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGFxaW5nIg==", # 大庆
  32. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGF0b25nIg==", # 大同
  33. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGF6aG91Ig==", # 达州
  34. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZGV6aG91Ig==", # 德州
  35. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZG9uZ2d1YW4i", # 东莞
  36. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZG9uZ3lpbmci", # 东营
  37. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZnV4aW4i", # 阜新
  38. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZnV5YW5nIg==", # 阜阳
  39. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZnV6aG91Ig==", # 福州
  40. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZ2FuemhvdSI=", # 赣州
  41. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZ3Vhbmd6aG91Ig==", # 广州
  42. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZ3VpZ2FuZyI=", # 贵港
  43. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZ3VpeWFuZyI=", # 贵阳
  44. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGFpa291Ig==", # 海口
  45. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGFuZGFuIg==", # 邯郸
  46. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGFuZ3pob3Ui", # 杭州
  47. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGViaSI=", # 鹤壁
  48. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGVmZWki", # 合肥
  49. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGVuZ3lhbmci", # 衡阳
  50. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGV5dWFuIg==", # 河源
  51. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaGV6ZSI=", # 菏泽
  52. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHVhaWh1YSI=", # 怀化
  53. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHVhaW5hbiI=", # 淮南
  54. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHVhbmdnYW5nIg==", # 黄冈
  55. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHVhbmdzaGki", # 黄石
  56. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHVpemhvdSI=", # 惠州
  57. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaHV6aG91Ig==", # 湖州
  58. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamlhbmdtZW4i", # 江门
  59. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamlhb3p1byI=", # 焦作
  60. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamlheGluZyI=", # 嘉兴
  61. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamlsaW4i", # 吉林
  62. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluYW4i", # 济南
  63. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluY2hlbmci", # 晋城
  64. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluZ2RlemhlbiI=", # 景德镇
  65. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluZ2hvbmci", # 景洪
  66. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluaHVhIg==", # 金华
  67. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluaW5nIg==", # 济宁
  68. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluemhvbmci", # 晋中
  69. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iamluemhvdSI=", # 锦州
  70. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaml1amlhbmci", # 九江
  71. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iaml5dWFuIg==", # 济源
  72. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ia2FpZmVuZyI=", # 开封
  73. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ia3VubWluZyI=", # 昆明
  74. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibGFuZ2Zhbmci", # 廊坊
  75. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibGFuemhvdSI=", # 兰州
  76. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibGlhb2NoZW5nIg==", # 聊城
  77. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibGlueWki", # 临沂
  78. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibG91ZGki", # 娄底
  79. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibHVvaGUi", # 漯河
  80. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibHVveWFuZyI=", # 洛阳
  81. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibWFvbWluZyI=", # 茂名
  82. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibWVpemhvdSI=", # 梅州
  83. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibXVkYW5qaWFuZyI=", # 牡丹江
  84. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmFuY2hhbmci", # 南昌
  85. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmFuY2hvbmci", # 南充
  86. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmFuamluZyI=", # 南京
  87. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmFubmluZyI=", # 南宁
  88. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmFueWFuZyI=", # 南阳
  89. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmluZ2JvIg==", # 宁波
  90. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ibmluZ2RlIg==", # 宁德
  91. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icGluZ2RpbmdzaGFuIg==", # 平顶山
  92. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icGluZ3hpYW5nIg==", # 萍乡
  93. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icHV5YW5nIg==", # 濮阳
  94. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icWluZ2RhbyI=", # 青岛
  95. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icWlvbmdoYWki", # 琼海
  96. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icXVhbnpob3Ui", # 泉州
  97. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icXV6aG91Ig==", # 衢州
  98. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icml6aGFvIg==", # 日照
  99. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2FubWVueGlhIg==", # 三门峡
  100. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2FueWEi", # 三亚
  101. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlhbWVuIg==", # 厦门
  102. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZm9zaGFuIg==", # 佛山
  103. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hhbmdxaXUi", # 商丘
  104. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hhb3hpbmci", # 绍兴
  105. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hhb3lhbmci", # 邵阳
  106. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hlbnlhbmci", # 沈阳
  107. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hlbnpoZW4i", # 深圳
  108. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hpamlhemh1YW5nIg==", # 石家庄
  109. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic2hpeWFuIg==", # 十堰
  110. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic29uZ3l1YW4i", # 松原
  111. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic3VpbmluZyI=", # 遂宁
  112. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic3V6aG91Ig==", # 苏州
  113. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0idGFpeXVhbiI=", # 太原
  114. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0idGFpemhvdSI=", # 泰州
  115. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0idGllbGluZyI=", # 铁岭
  116. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id2VpZmFuZyI=", # 潍坊
  117. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id2VpaGFpIg==", # 威海
  118. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id2VpbmFuIg==", # 渭南
  119. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id2VuemhvdSI=", # 温州
  120. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id3VoYW4i", # 武汉
  121. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id3VodSI=", # 芜湖
  122. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id3V4aSI=", # 无锡
  123. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0id3V6aG91Ig==", # 梧州
  124. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlhbiI=", # 西安
  125. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlhbmd0YW4i", # 湘潭
  126. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGljaGFuZyI=", # 西昌
  127. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlueGlhbmci", # 新乡
  128. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlueWFuZyI=", # 信阳
  129. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGlueXUi", # 新余
  130. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ic3VxaWFuIg==", # 宿迁
  131. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieHVjaGFuZyI=", # 许昌
  132. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieHV6aG91Ig==", # 徐州
  133. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWFuY2hlbmci", # 盐城
  134. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWFuZ2ppYW5nIg==", # 阳江
  135. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWFuZ3pob3Ui", # 扬州
  136. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWFuamki", # 延吉
  137. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWFudGFpIg==", # 烟台
  138. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWljaHVuIg==", # 宜春
  139. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWluZ2tvdSI=", # 营口
  140. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieWl5YW5nIg==", # 益阳
  141. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieW9uZ3pob3Ui", # 永州
  142. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieXVleWFuZyI=", # 岳阳
  143. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieXVsaW4i", # 玉林
  144. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieXVuY2hlbmci", # 运城
  145. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hhbmdjaHVuIg==", # 长春
  146. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhhbmdqaWFqaWUi", # 张家界
  147. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iY2hhbmdzaGEi", # 长沙
  148. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhhbmd6aG91Ig==", # 漳州
  149. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhhbmppYW5nIg==", # 湛江
  150. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhhb3Fpbmci", # 肇庆
  151. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhhb3Rvbmci", # 昭通
  152. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhlbmd6aG91Ig==", # 郑州
  153. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhvbmdzaGFuIg==", # 中山
  154. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhvdWtvdSI=", # 周口
  155. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemhvdXNoYW4i", # 舟山
  156. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemh1aGFpIg==", # 珠海
  157. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemh1bWFkaWFuIg==", # 驻马店
  158. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemh1emhvdSI=", # 株洲
  159. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iemlnb25nIg==", # 自贡
  160. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iZnVxaW5nIg==", # 福清
  161. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0iYmFvdG91Ig==", # 包头
  162. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieml5YW5nIg==", # 资阳
  163. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0ieGluamki", # 辛集
  164. "https://fofa.info/result?qbase64=ImlwdHYvbGl2ZS96aF9jbi5qcyIgJiYgY2l0eT0icWl0YWloZSI=", # 七台河
  165. ]
  166. def modify_urls(url):
  167. modified_urls = []
  168. ip_start_index = url.find("//") + 2
  169. ip_end_index = url.find(":", ip_start_index)
  170. base_url = url[:ip_start_index] # http:// or https://
  171. ip_address = url[ip_start_index:ip_end_index]
  172. port = url[ip_end_index:]
  173. ip_end = "/iptv/live/1000.json?key=txiptv"
  174. for i in range(1, 256):
  175. modified_ip = f"{ip_address[:-1]}{i}"
  176. modified_url = f"{base_url}{modified_ip}{port}{ip_end}"
  177. modified_urls.append(modified_url)
  178. return modified_urls
  179. def is_url_accessible(url):
  180. try:
  181. response = requests.get(url, timeout=1)
  182. if response.status_code == 200:
  183. return url
  184. except requests.exceptions.RequestException:
  185. pass
  186. return None
  187. results = []
  188. for url in urls:
  189. try:
  190. response = requests.get(url, timeout = 15)
  191. if response.status_code == 200:
  192. print(response)
  193. page_content = response.content.decode('utf-8')
  194. # 查找所有符合指定格式的网址
  195. pattern = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+" # 设置匹配的格式,如http://8.8.8.8:8888
  196. urls_all = re.findall(pattern, page_content)
  197. # urls = list(set(urls_all)) # 去重得到唯一的URL列表
  198. urls = set(urls_all) # 去重得到唯一的URL列表
  199. x_urls = []
  200. for url in urls: # 对urls进行处理,ip第四位修改为1,并去重
  201. url = url.strip()
  202. ip_start_index = url.find("//") + 2
  203. ip_end_index = url.find(":", ip_start_index)
  204. ip_dot_start = url.find(".") + 1
  205. ip_dot_second = url.find(".", ip_dot_start) + 1
  206. ip_dot_three = url.find(".", ip_dot_second) + 1
  207. base_url = url[:ip_start_index] # http:// or https://
  208. ip_address = url[ip_start_index:ip_dot_three]
  209. port = url[ip_end_index:]
  210. ip_end = "1"
  211. modified_ip = f"{ip_address}{ip_end}"
  212. x_url = f"{base_url}{modified_ip}{port}"
  213. x_urls.append(x_url)
  214. urls = set(x_urls) # 去重得到唯一的URL列表
  215. valid_urls = []
  216. # 多线程获取可用url
  217. with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:
  218. futures = []
  219. for url in urls:
  220. url = url.strip()
  221. modified_urls = modify_urls(url)
  222. for modified_url in modified_urls:
  223. futures.append(executor.submit(is_url_accessible, modified_url))
  224. for future in concurrent.futures.as_completed(futures):
  225. result = future.result()
  226. if result:
  227. valid_urls.append(result)
  228. for url in valid_urls:
  229. print(url)
  230. # 遍历网址列表,获取JSON文件并解析
  231. for url in valid_urls:
  232. try:
  233. # 发送GET请求获取JSON文件,设置超时时间为0.5秒
  234. ip_start_index = url.find("//") + 2
  235. ip_dot_start = url.find(".") + 1
  236. ip_index_second = url.find("/", ip_dot_start)
  237. base_url = url[:ip_start_index] # http:// or https://
  238. ip_address = url[ip_start_index:ip_index_second]
  239. url_x = f"{base_url}{ip_address}"
  240. json_url = f"{url}"
  241. response = requests.get(json_url, timeout=1)
  242. json_data = response.json()
  243. try:
  244. # 解析JSON文件,获取name和url字段
  245. for item in json_data['data']:
  246. if isinstance(item, dict):
  247. name = item.get('name')
  248. urlx = item.get('url')
  249. if 'http' in urlx:
  250. urld = f"{urlx}"
  251. else:
  252. urld = f"{url_x}{urlx}"
  253. if name and urld:
  254. # 删除特定文字
  255. name = name.replace("cctv", "CCTV")
  256. name = name.replace("中央", "CCTV")
  257. name = name.replace("央视", "CCTV")
  258. name = name.replace("高清", "")
  259. name = name.replace("超高", "")
  260. name = name.replace("HD", "")
  261. name = name.replace("标清", "")
  262. name = name.replace("频道", "")
  263. name = name.replace("-", "")
  264. name = name.replace(" ", "")
  265. name = name.replace("PLUS", "+")
  266. name = name.replace("+", "+")
  267. name = name.replace("(", "")
  268. name = name.replace(")", "")
  269. name = re.sub(r"CCTV(\d+)台", r"CCTV\1", name)
  270. name = name.replace("CCTV1综合", "CCTV1")
  271. name = name.replace("CCTV2财经", "CCTV2")
  272. name = name.replace("CCTV3综艺", "CCTV3")
  273. name = name.replace("CCTV4国际", "CCTV4")
  274. name = name.replace("CCTV4中文国际", "CCTV4")
  275. name = name.replace("CCTV4欧洲", "CCTV4")
  276. name = name.replace("CCTV5体育", "CCTV5")
  277. name = name.replace("CCTV6电影", "CCTV6")
  278. name = name.replace("CCTV7军事", "CCTV7")
  279. name = name.replace("CCTV7军农", "CCTV7")
  280. name = name.replace("CCTV7农业", "CCTV7")
  281. name = name.replace("CCTV7国防军事", "CCTV7")
  282. name = name.replace("CCTV8电视剧", "CCTV8")
  283. name = name.replace("CCTV9记录", "CCTV9")
  284. name = name.replace("CCTV9纪录", "CCTV9")
  285. name = name.replace("CCTV10科教", "CCTV10")
  286. name = name.replace("CCTV11戏曲", "CCTV11")
  287. name = name.replace("CCTV12社会与法", "CCTV12")
  288. name = name.replace("CCTV13新闻", "CCTV13")
  289. name = name.replace("CCTV新闻", "CCTV13")
  290. name = name.replace("CCTV14少儿", "CCTV14")
  291. name = name.replace("CCTV15音乐", "CCTV15")
  292. name = name.replace("CCTV16奥林匹克", "CCTV16")
  293. name = name.replace("CCTV17农业农村", "CCTV17")
  294. name = name.replace("CCTV17农业", "CCTV17")
  295. name = name.replace("CCTV5+体育赛视", "CCTV5+")
  296. name = name.replace("CCTV5+体育赛事", "CCTV5+")
  297. name = name.replace("CCTV5+体育", "CCTV5+")
  298. urld = urld.replace("udp://@", "/udp/")
  299. urld = urld.replace("udp://", "/udp/")
  300. urld = urld.replace("rtp://@", "/rtp/")
  301. urld = urld.replace("rtp://", "/rtp/")
  302. results.append(f"{name},{urld}")
  303. except:
  304. continue
  305. except:
  306. continue
  307. except:
  308. continue
  309. results = set(results) # 去重得到唯一的URL列表
  310. results = sorted(results)
  311. with open("itv.txt", 'w', encoding='utf-8') as file:
  312. for result in results:
  313. file.write(result + "\n")
  314. print(result)