票圈爬虫平台

wangkun a828bd3aa4 update 2 年之前
common a828bd3aa4 update 2 年之前
kanyikan 7a636d7b26 update 2 年之前
main 7a636d7b26 update 2 年之前
weixinzhishu a828bd3aa4 update 2 年之前
xigua a828bd3aa4 update 2 年之前
youtube f110fe29d8 update 2 年之前
.DS_Store a828bd3aa4 update 2 年之前
.gitignore a654a13503 first push 2 年之前
README.MD ffb8fe125c update 2 年之前
requirements.txt a828bd3aa4 update 2 年之前

README.MD

爬虫平台

启动

  1. cd ./piaoquan_crawler
  2. sh ./main/main.sh ${crawler_dir} ${log_type} ${crawler} ${strategy} ${oss_endpoint} ${env} ${machine} ${nohup_dir}

    参数说明
    ${crawler_dir}:     爬虫执行路径,如: ./youtube/youtube_main/run_youtube_follow.py
    ${log_type}:        日志命名格式,如: follow,则在 youtube/logs/目录下,生成 2023-02-08-follow.log
    ${crawler}:         哪款爬虫,如: youtube / kanyikan / weixinzhishu
    ${strategy}:        爬虫策略,如: 定向爬虫策略 / 小时榜爬虫策略 / 热榜爬虫策略
    ${oss_endpoint}:    OSS网关,内网: inner / 外网: out / 香港: hk
    ${env}:             爬虫运行环境,正式环境: prod / 测试环境: dev
    ${machine}:         爬虫运行机器,阿里云服务器: aliyun_hk / aliyun / macpro / macair / local
    ${nohup_dir}:       nohup日志存储路径,如: ./youtube/nohup.log
    

已上线爬虫运行命令示例

youtube定向榜运行命令: 
sh ./main/main.sh ./youtube/youtube_main/run_youtube_follow.py --log_type="follow" --crawler="youtube" --strategy="定向爬虫策略" --oss_endpoint="hk" --env="prod" --machine="aliyun_hk" youtube/nohup.log
youtube定向榜杀进程命令: 
ps aux | grep run_youtube | grep -v grep | awk '{print $2}' | xargs kill -9
ps aux | grep run_youtube | grep Python | grep -v grep | awk '{print $2}' | xargs kill -9