f
This commit is contained in:
@@ -1175,6 +1175,18 @@ class Telegram(Provider):
|
||||
raise ValueError("Not a Telegram URL")
|
||||
return self._download_message_media_sync(url=url, output_dir=output_dir)
|
||||
|
||||
def handle_url(self, url: str, *, output_dir: Optional[Path] = None) -> Tuple[bool, Optional[Path]]:
|
||||
"""Optional provider override to parse and act on URLs."""
|
||||
if not _looks_like_telegram_message_url(url):
|
||||
return False, None
|
||||
|
||||
try:
|
||||
path, _info = self.download_url(url, output_dir or Path("."))
|
||||
return True, path
|
||||
except Exception as e:
|
||||
debug(f"[telegram] handle_url failed for {url}: {e}")
|
||||
return False, None
|
||||
|
||||
def download(self, result: SearchResult, output_dir: Path) -> Optional[Path]:
|
||||
url = str(getattr(result, "path", "") or "")
|
||||
if not url:
|
||||
|
||||
Reference in New Issue
Block a user