Add TMDBExtractor class for movie information extraction

- Implement TMDBExtractor to fetch movie details from The Movie Database (TMDB) API.
- Include caching mechanism for API responses to reduce redundant requests.
- Extract movie database ID from filenames using regex patterns.
- Add methods to extract TMDB ID, title, original title, release year, and TMDB URL.
- Create secrets.py to store TMDB API key and access token.
- Add a sample MKV file for testing purposes.
This commit is contained in:
sha
2025-12-28 09:02:42 +00:00
parent 97bacf602c
commit 9a78dc2540
10 changed files with 439 additions and 5 deletions
+16 -1
View File
@@ -100,4 +100,19 @@ class TextFormatter:
@staticmethod
def dim(text: str) -> str:
return f"[dim]{text}[/dim]"
return f"[dim]{text}[/dim]"
@staticmethod
def link(url: str, text: str | None = None) -> str:
"""Create a clickable link. If text is None, uses the URL as text."""
if text is None:
text = url
return f"[link={url}]{text}[/link]"
@staticmethod
def format_url(url: str) -> str:
"""Format a URL as a clickable link using OSC 8 if it's a valid URL, otherwise return as-is."""
if url and url != "<None>" and url.startswith("http"):
# Use OSC 8 hyperlink escape sequence for clickable links
return f"\x1b]8;;{url}\x1b\\Open in TMDB\x1b]8;;\x1b\\"
return url