"""Series streaming sites (catalogs) downloaders"""
from .base import BaseSeriesSite
# Import all series site downloaders
from .fs7 import FS7Downloader
from .zonetelechargement import ZoneTelechargementDownloader

__all__ = [
    "BaseSeriesSite",
    "FS7Downloader",
    "ZoneTelechargementDownloader",
]


def get_series_site(url: str) -> BaseSeriesSite:
    """Factory function to get the appropriate series site for a URL"""
    sites = [
        FS7Downloader(),
        ZoneTelechargementDownloader(),
    ]

    for site in sites:
        if site.can_handle(url):
            return site

    # Return None if no match (should not happen in normal flow)
    return None
