From 20a4e6e2eb40b694b355cf3482999f0d6075a57d Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Sat, 11 Jul 2026 09:42:52 -0600 Subject: [PATCH] feat(tags): add imdb_api_enabled toggle, off by default --- docs/reference/configuration.md | 3 ++- unshackle/core/config.py | 1 + unshackle/core/providers/imdbapi.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 17a8205c..abdfcf84 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -37,7 +37,7 @@ This page assumes you already know the basics and want precise details. | [DRM & CDM](#drm-cdm) | `cdm`, `remote_cdm`, `decryption` | | [Network & proxy](#network-proxy) | `network`, `headers`, `proxy_providers` | | [Key vaults](#key-vaults) | `key_vaults`, `vault_timeout` | -| [External API keys](#external-api-keys) | `tmdb_api_key`, `simkl_client_id`, `decrypt_labs_api_key`, `ipinfo_api_key` | +| [External API keys](#external-api-keys) | `imdb_api_enabled`, `tmdb_api_key`, `simkl_client_id`, `decrypt_labs_api_key`, `ipinfo_api_key` | | [Caching & updates](#caching-updates) | `title_cache_enabled`, `title_cache_time`, `title_cache_max_retention`, `update_checks`, `update_check_interval` | | [Logging, privacy & debug](#logging-privacy-debug) | `redact_paths`, `debug`, `debug_keys`, `debug_requests`, `set_terminal_bg` | | [Deprecated & removed](#deprecated-removed-keys) | `curl_impersonate`, `downloader`, `scene_naming` | @@ -748,6 +748,7 @@ All default to an empty string and enable optional metadata/geolocation features | Key | Type | Default | Description | |-----|------|---------|-------------| +| `imdb_api_enabled` | bool | `false` | Use the free imdbapi.dev metadata provider, which needs no API key. Off by default since the site has been unreliable. | | `tmdb_api_key` | str | `""` | TMDB API key for metadata enrichment and external-ID tags. | | `simkl_client_id` | str | `""` | SIMKL client ID for metadata lookups; an alternative/fallback source to TMDB. | | `decrypt_labs_api_key` | str | `""` | Global Decrypt Labs API key (used by remote CDM / vault). | diff --git a/unshackle/core/config.py b/unshackle/core/config.py index 9aa160b8..a8008741 100644 --- a/unshackle/core/config.py +++ b/unshackle/core/config.py @@ -114,6 +114,7 @@ class Config: self.tag: str = kwargs.get("tag") or "" self.tag_group_name: bool = kwargs.get("tag_group_name", True) self.tag_imdb_tmdb: bool = kwargs.get("tag_imdb_tmdb", True) + self.imdb_api_enabled: bool = kwargs.get("imdb_api_enabled", False) self.tmdb_api_key: str = kwargs.get("tmdb_api_key") or "" self.simkl_client_id: str = kwargs.get("simkl_client_id") or "" self.decrypt_labs_api_key: str = kwargs.get("decrypt_labs_api_key") or "" diff --git a/unshackle/core/providers/imdbapi.py b/unshackle/core/providers/imdbapi.py index b8189277..38616421 100644 --- a/unshackle/core/providers/imdbapi.py +++ b/unshackle/core/providers/imdbapi.py @@ -5,6 +5,7 @@ from typing import Optional, Union import requests +from unshackle.core.config import config from unshackle.core.providers._base import ExternalIds, MetadataProvider, MetadataResult, _clean, fuzzy_match # Mapping from our kind ("movie"/"tv") to imdbapi.dev title types @@ -22,7 +23,7 @@ class IMDBApiProvider(MetadataProvider): BASE_URL = "https://api.imdbapi.dev" def is_available(self) -> bool: - return True # no key needed + return config.imdb_api_enabled def search(self, title: str, year: Optional[int], kind: str) -> Optional[MetadataResult]: self.log.debug("Searching IMDBApi for %r (%s, %s)", title, kind, year)