[+] Caching

This commit is contained in:
2026-03-09 00:42:28 -04:00
parent 96110dac9e
commit 2dd9fc344a
4 changed files with 49 additions and 6 deletions
+5
View File
@@ -1,7 +1,10 @@
import json
import requests
import tomllib
from pathlib import Path
from utils import with_disk_cache
config = tomllib.loads(Path("config.toml").read_text())
def _get_mteam_headers() -> dict:
@@ -19,6 +22,7 @@ def _get_mteam_headers() -> dict:
}
@with_disk_cache('search_mteam_torrents')
def search_mteam_torrents(imdb_url: str, page_number: int = 1, page_size: int = 100) -> dict:
"""
Search M-Team for torrents using IMDb URL.
@@ -47,6 +51,7 @@ def search_mteam_torrents(imdb_url: str, page_number: int = 1, page_size: int =
return response.json()
@with_disk_cache('mteam_imdb_info')
def mteam_imdb_info(id: str) -> dict:
"""
Search M-Team for torrents using IMDb URL.