- 缓存热点批量流程(有采集缓存不触发 Google) - 简报不足直接从采集缓存生成(轻量补齐) - 三图合成(模特/印花/底图)+ 底图压缩 <2MB - 热点去重→风格去重自动切换 + 不适合类目 review 兜底 - 透明背景(background=transparent)+ 提示词清洗(敏感词/背景描述) - 任务前 basemap 校验 + 模板国家校验 + 模特任务级分配
23 lines
655 B
Python
23 lines
655 B
Python
"""数据源注册表(可插拔入口)。
|
|
|
|
config.yaml 的 ``sources: [google_trends, pinterest]`` 决定启用哪些。
|
|
新增数据源:实现 graph/sources/base.DataSource,在此登记即可。
|
|
"""
|
|
from typing import Dict
|
|
|
|
from .base import DataSource
|
|
from .google_trends_source import GoogleTrendsSource
|
|
from .pinterest_source import PinterestSource
|
|
|
|
SOURCES: Dict[str, type] = {
|
|
"google_trends": GoogleTrendsSource,
|
|
"pinterest": PinterestSource,
|
|
}
|
|
|
|
|
|
def get_source(name: str) -> DataSource:
|
|
cls = SOURCES.get(name)
|
|
if cls is None:
|
|
raise ValueError(f"未知数据源: {name},可用: {list(SOURCES)}")
|
|
return cls()
|