This commit is contained in:
2025-12-30 05:48:01 -08:00
parent 925a1631bc
commit a97657a757
3 changed files with 224 additions and 58 deletions

View File

@@ -1476,6 +1476,36 @@ class HydrusNetwork(Store):
debug(f"{self._log_prefix()} get_url failed: {exc}")
return []
def get_url_info(self, url: str, **kwargs: Any) -> dict[str, Any] | None:
"""Return Hydrus URL info for a single URL (Hydrus-only helper).
Uses: GET /add_urls/get_url_info
"""
try:
client = self._client
if client is None:
return None
u = str(url or "").strip()
if not u:
return None
try:
return client.get_url_info(u) # type: ignore[attr-defined]
except Exception:
from API.HydrusNetwork import HydrusRequestSpec
spec = HydrusRequestSpec(
method="GET",
endpoint="/add_urls/get_url_info",
query={
"url": u
},
)
response = client._perform_request(spec) # type: ignore[attr-defined]
return response if isinstance(response, dict) else None
except Exception as exc:
debug(f"{self._log_prefix()} get_url_info failed: {exc}")
return None
def add_url(self, file_identifier: str, url: List[str], **kwargs: Any) -> bool:
"""Associate one or more url with a Hydrus file."""
try: