feat: add docker match live stream crawler
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
python main.py nba_news # 采集NBA新闻资讯
|
||||
python main.py cba_news # 采集CBA新闻资讯
|
||||
python main.py ai_comment_dispatch # Docker AI 评论调度
|
||||
python main.py match_live_stream # 抓取赛事直播线路播放流
|
||||
python main.py article_content_fetch # 抓取资讯文章正文内容
|
||||
python main.py all # 采集积分榜 + 赛程
|
||||
python main.py single <season_id> # 采集单个联赛积分榜
|
||||
@@ -59,6 +60,7 @@ TASK_ALERT_POLICY = {
|
||||
"lottery_draw": "saved_if_candidates",
|
||||
"lottery_draw_force": "saved_if_candidates",
|
||||
"ai_comment_dispatch": "saved_if_candidates",
|
||||
"match_live_stream": "saved_if_candidates",
|
||||
}
|
||||
|
||||
DEFAULT_ACTION_TIMEOUT = 600
|
||||
@@ -86,6 +88,7 @@ ACTION_TIMEOUTS = {
|
||||
"fifa_worldcup_news": 600,
|
||||
"dqd_worldcup": 600,
|
||||
"ai_comment_dispatch": 1800,
|
||||
"match_live_stream": 180,
|
||||
}
|
||||
|
||||
|
||||
@@ -522,6 +525,24 @@ async def cmd_ai_comment_dispatch():
|
||||
return await asyncio.to_thread(run, db_config)
|
||||
|
||||
|
||||
async def cmd_match_live_stream():
|
||||
import asyncio
|
||||
from match_live_stream import run
|
||||
from src.core.config import load_config
|
||||
|
||||
cfg = load_config().database
|
||||
db_config = {
|
||||
"host": cfg.host,
|
||||
"port": cfg.port,
|
||||
"user": cfg.username,
|
||||
"password": cfg.password,
|
||||
"database": cfg.database,
|
||||
"charset": cfg.charset,
|
||||
"prefix": cfg.prefix,
|
||||
}
|
||||
return await asyncio.to_thread(run, db_config)
|
||||
|
||||
|
||||
async def cmd_match_data():
|
||||
from src.scheduler.task_runner import TaskRunner
|
||||
async with TaskRunner() as runner:
|
||||
@@ -837,6 +858,7 @@ def main():
|
||||
"nba_news": cmd_nba_news,
|
||||
"cba_news": cmd_cba_news,
|
||||
"ai_comment_dispatch": cmd_ai_comment_dispatch,
|
||||
"match_live_stream": cmd_match_live_stream,
|
||||
"article_content_fetch": cmd_article_content_fetch,
|
||||
"match_finish": cmd_match_finish,
|
||||
"live_detail": cmd_live_detail,
|
||||
|
||||
Reference in New Issue
Block a user