Files
ohm_streaming/app/downloaders/__init__.py
root 3b405f2a42
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled
feat: add Zone-Telechargement provider and automatic TLD verification
- Implemented DomainManager in app/utils.py for TLD rotation and caching.
- Created ZoneTelechargementDownloader in app/downloaders/series_sites/zonetelechargement.py.
- Integrated Zone-Telechargement into series search and provider list.
- Updated .gitignore to exclude domain_cache.json.
2026-03-26 13:01:50 +00:00

71 lines
1.8 KiB
Python

from .base import BaseDownloader
# Import from new organized structure
from .video_players import (
BaseVideoPlayer,
get_video_player,
DoodStreamDownloader,
SibnetDownloader,
VidMolyDownloader,
SendVidDownloader,
LpayerDownloader,
UnFichierDownloader,
UptoboxDownloader,
RapidFileDownloader
)
from .anime_sites import (
BaseAnimeSite,
get_anime_site,
AnimeSamaDownloader,
NekoSamaDownloader,
AnimeUltimeDownloader,
VostfreeDownloader
)
from .series_sites import (
BaseSeriesSite,
get_series_site,
FS7Downloader,
ZoneTelechargementDownloader
)
def get_downloader(url: str) -> BaseDownloader:
"""
Factory function to get the appropriate downloader for a URL.
This function now uses the organized structure:
- Checks anime sites first (for catalogs/search)
- Then checks series sites (for catalogs/search)
- Then checks video players (for direct download links)
- Falls back to generic downloader if no match
"""
# Try anime sites first
anime_site = get_anime_site(url)
if anime_site:
return anime_site
# Then try series sites
series_site = get_series_site(url)
if series_site:
return series_site
# Then try video players
video_player = get_video_player(url)
if video_player:
return video_player
# Return generic downloader if no match
return GenericDownloader()
class GenericDownloader(BaseDownloader):
"""Generic downloader for unhandled hosts"""
def can_handle(self, url: str) -> bool:
return True
async def get_download_link(self, url: str, target_filename: str = None) -> tuple[str, str]:
# Just return the URL as-is
filename = target_filename or url.split('/')[-1] or "download"
return url, filename