# -*- coding: utf-8 -*-
"""
平台发布模块
支持: 抖音、小红书、视频号、快手、百家号
"""

from .base import BasePublisher
from .douyin import DouyinPublisher
from .xiaohongshu import XiaohongshuPublisher
from .weixin import WeixinPublisher
from .kuaishou import KuaishouPublisher
from .baijiahao import BaijiahaoPublisher

__all__ = [
    'BasePublisher',
    'DouyinPublisher',
    'XiaohongshuPublisher',
    'WeixinPublisher',
    'KuaishouPublisher',
    'BaijiahaoPublisher',
]

# 平台映射
PLATFORM_MAP = {
    'douyin': DouyinPublisher,
    'xiaohongshu': XiaohongshuPublisher,
    'weixin': WeixinPublisher,
    'weixin_video': WeixinPublisher,  # 别名
    'shipinhao': WeixinPublisher,  # 别名（视频号）
    'kuaishou': KuaishouPublisher,
    'baijiahao': BaijiahaoPublisher,
}


def get_publisher(platform: str) -> type:
    """获取平台发布器类"""
    publisher_class = PLATFORM_MAP.get(platform.lower())
    if not publisher_class:
        raise ValueError(f"不支持的平台: {platform}，支持的平台: {list(PLATFORM_MAP.keys())}")
    return publisher_class
