"""Vidzy video hosting service downloader""" import logging from typing import Optional from .base import BaseVideoPlayer from bs4 import BeautifulSoup from app.utils import sanitize_filename logger = logging.getLogger(__name__) class VidzyDownloader(BaseVideoPlayer): """ Downloader for Vidzy video hosting service. Vidzy is a video hosting platform used by various anime streaming sites. """ def can_handle(self, url: str) -> bool: """Check if this downloader can handle the given URL""" return "vidzy" in url.lower() async def get_download_link( self, url: str, target_filename: Optional[str] = None ) -> tuple[str, str]: """ Extract direct download link and filename from Vidzy URL. Args: url: The Vidzy video player URL target_filename: Optional filename override Returns: Tuple of (download_url, filename) """ try: logger.info(f"Fetching Vidzy URL: {url}") # Fetch the page response = await self.client.get(url) response.raise_for_status() html = response.text soup = BeautifulSoup(html, 'lxml') # Method 1: Look for video source in