暗网采集(新版) ——推送到采集平台的数据字段都和新闻的一样
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.6 KiB

6 months ago
  1. # dark_net_crawler
  2. 暗网采集(新版)
  3. ——推送到采集平台的数据字段都和新闻的一样
  4. 1. 新闻网站:
  5. http://pr3ygifxd23xu43be2fegjjsk5jlb22q2va2h5apz76ejbvammeclkid.onion/
  6. 2. 交易网站:
  7. http://potshopk4eov76aciyranqyq2r3mszuvfisvneytodfxo56ubha7doqd.onion/?post_type=product
  8. 部署说明:
  9. 1. 线上 47.252.23.168 机器(已翻墙)上,部署了:
  10. (1)项目部署路径:
  11. /opt/crawl/dark_net/dark_net_crawler
  12. 沙箱环境:
  13. conda activate pdf_crawler_py3.8
  14. python环境为3.8
  15. (2)暗网采集代理的Tor服务-------代理地址:socks5h://localhost:9050
  16. CentOS+tor+Privoxy 服务搭建(要出墙tor才可正常使用):
  17. sudo yum install epel-release 不然没有源
  18. sudo yum install tor
  19. service tor start 启动服务
  20. service tor status 检查服务状态
  21. (3)Privoxy:将SOCKS5代理转换为HTTP代理:http://172.18.1.103:19050(最终暗网采集项目中 使用的代理地址:见 settings.py)
  22. sudo yum install privoxy 安装
  23. 修改一下privoxy 配置文件 将tor 和privoxy整合
  24. vim /ect/privoxy/config
  25. 将 listen-address 改为0.0.0.0:19095
  26. 搜索 forward-socks5t 找到注释拿掉
  27. ESC wq保存退出
  28. 启动privoxy
  29. service privoxy start
  30. 启动完成检查状态 status 这样就完成了服务搭建
  31. 设置完成代理 检查是否成功
  32. curl -x http://172.18.1.103:19050 'http://pr3ygifxd23xu43be2fegjjsk5jlb22q2va2h5apz76ejbvammeclkid.onion/'
  33. curl -x http://172.18.1.103:19050 'http://httpbin.org/ip'
  34. curl -x socks5h://localhost:9050 'http://httpbin.org/ip'
  35. curl 'http://httpbin.org/ip'
  36. ![img_1.png](img_1.png)
  37. 2. 本地或线上一次性运行启动入口:python entrypoint.py
  38. 依赖安装:pip install -r requirements.txt --python-version 3.8
  39. 线上周期定时采集:
  40. conda activate pdf-crawler(进入沙箱环境)
  41. python scheduled_run.py (每周五采集一次)
  42. 3. (1) 数据连接的Kafka配置:
  43. dark_net_crawler/utils/kafka_config.py
  44. (2) 输出到采集平台的数据格式:(和新闻字段一致)
  45. 见:dark_net_crawler/items.py
  46. 如果想把新采集的数据覆盖掉:version字段值递增即可。 items['version'] = 2
  47. 4. 日志打印--按天输出,只保留近7天:
  48. dark_net_crawler/utils/fb-download-logs/2024-07-18.log
  49. 5. 两个网站的采集解析逻辑:
  50. dark_net_crawler/spiders/news_denkbares.py
  51. dark_net_crawler/spiders/shop_pot.py