This commit is contained in:
2026-01-12 04:05:52 -08:00
parent 6076ea307b
commit 9981424397
11 changed files with 646 additions and 682 deletions

View File

@@ -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: