Browse Source

fix: 修改账号信息、定时清除脚本

master
steve.gao 6 months ago
parent
commit
03d32c797c
  1. 4
      clean.py
  2. 3
      tg_module/receive_message.py

4
clean.py

@ -7,8 +7,8 @@ import shutil
"""
0 0 * * * cd /opt/crawl/telegram/telegram-crawler && /root/anaconda3/envs/python3.8/bin/python clean.py > /dev/null 2>&1
cd /opt/crawl/telegram/telegram-crawler && /root/anaconda3/envs/python3.8/bin/python clean.py > /dev/null 2>&1
0 0 * * * conda activate python3.8 && cd /opt/crawl/telegram/telegram_crawler && python clean.py > /dev/null 2>&1
conda activate python3.8 && cd /opt/crawl/telegram/telegram_crawler && python clean.py > /dev/null 2>&1
"""

3
tg_module/receive_message.py

@ -190,7 +190,8 @@ async def main(session_string, api_id, api_hash, kp=None, message_topic=""):
async def mul_account():
client_mysql = MysqlPoolClient(CRAWLER_DB_CONF)
sql = f"select * from {TG_ROBOT_ACCOUNT_TABLE} where api_id!='28340634' order by update_time"
# 排除 18443104914(有效)、18846824798(无效) 账号
sql = f"select * from {TG_ROBOT_ACCOUNT_TABLE} where api_id='22955009' order by update_time"
results = client_mysql.getAll(sql)
kp = SKafka(bootstrap_servers=TOPIC_ADDRESS)
message_topic = TOPIC_DIC["testtelegram"]

Loading…
Cancel
Save