Spaces:
Build error
Build error
File size: 533 Bytes
f169c98 8d2f9d4 f169c98 8d2f9d4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# media_handler.py
from abc import ABC, abstractmethod
import logging
from app.services.download_media import download_whatsapp_media
logger = logging.getLogger(__name__)
class MediaHandler(ABC):
@abstractmethod
async def download(self, media_id: str, whatsapp_token: str, file_path: str) -> str:
pass
class WhatsAppMediaHandler(MediaHandler):
async def download(self, media_id: str, whatsapp_token: str, file_path: str) -> str:
return await download_whatsapp_media(media_id, whatsapp_token, file_path) |