diff --git a/modules/builder.py b/modules/builder.py index 83c8ed58..834f0bfb 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1,6 +1,6 @@ import logging, os, re, time from datetime import datetime, timedelta -from modules import anidb, anilist, flixpatrol, icheckmovies, imdb, letterboxd, mal, plex, radarr, sonarr, stevenlu, tautulli, tmdb, trakt, tvdb, util +from modules import anidb, anilist, flixpatrol, icheckmovies, imdb, letterboxd, mal, plex, radarr, sonarr, stevenlu, tautulli, tmdb, trakt, tvdb, mdblist, util from modules.util import Failed, ImageData, NotScheduled, NotScheduledRange from PIL import Image from plexapi.audio import Artist, Album, Track @@ -70,7 +70,7 @@ filter_translation = { modifier_alias = {".greater": ".gt", ".less": ".lt"} all_builders = anidb.builders + anilist.builders + flixpatrol.builders + icheckmovies.builders + imdb.builders + \ letterboxd.builders + mal.builders + plex.builders + stevenlu.builders + tautulli.builders + \ - tmdb.builders + trakt.builders + tvdb.builders + tmdb.builders + trakt.builders + tvdb.builders + mdblist.builders show_only_builders = ["tmdb_network", "tmdb_show", "tmdb_show_details", "tvdb_show", "tvdb_show_details", "collection_level", "item_tmdb_season_titles"] movie_only_builders = [ "letterboxd_list", "letterboxd_list_details", "icheckmovies_list", "icheckmovies_list_details", "stevenlu_popular", @@ -551,6 +551,8 @@ class CollectionBuilder: self._trakt(method_name, method_data) elif method_name in tvdb.builders: self._tvdb(method_name, method_data) + elif method_name in mdblist.builders: + self._mdblist(method_name, method_data) elif method_name == "filters": self._filters(method_name, method_data) else: @@ -1077,6 +1079,9 @@ class CollectionBuilder: def _stevenlu(self, method_name, method_data): self.builders.append((method_name, self._parse(method_name, method_data, "bool"))) + def _mdblist(self, method_name, method_data): + self.builders.append((method_name, self._parse(method_name, method_data, datatype="true"))) + def _tautulli(self, method_name, method_data): for dict_data, dict_methods in self._parse(method_name, method_data, datatype="dictlist"): self.builders.append((method_name, { @@ -1263,6 +1268,8 @@ class CollectionBuilder: return self.config.Letterboxd.get_tmdb_ids(method, value, self.language) elif "stevenlu" in method: return self.config.StevenLu.get_stevenlu_ids(method) + elif "mdblist" in method: + return self.config.Mdblist.get_mdblist_ids(method, value) elif "tmdb" in method: return self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie) elif "trakt" in method: diff --git a/modules/config.py b/modules/config.py index 4463266b..26229e85 100644 --- a/modules/config.py +++ b/modules/config.py @@ -18,6 +18,7 @@ from modules.plex import Plex from modules.radarr import Radarr from modules.sonarr import Sonarr from modules.stevenlu import StevenLu +from modules.mdblist import Mdblist from modules.tautulli import Tautulli from modules.tmdb import TMDb from modules.trakt import Trakt @@ -480,6 +481,7 @@ class ConfigFile: self.ICheckMovies = ICheckMovies(self) self.Letterboxd = Letterboxd(self) self.StevenLu = StevenLu(self) + self.Mdblist = Mdblist(self) util.separator() diff --git a/modules/mdblist.py b/modules/mdblist.py new file mode 100644 index 00000000..58747094 --- /dev/null +++ b/modules/mdblist.py @@ -0,0 +1,20 @@ +import logging +from modules.util import Failed + +logger = logging.getLogger("Plex Meta Manager") + +builders = ["mdblist_list"] +base_url = "https://mdblist.com/lists" + +headers = { 'User-Agent': 'Plex-Meta-Manager' } + +class Mdblist: + def __init__(self, config): + self.config = config + + def get_mdblist_ids(self, method, data): + if method == "mdblist_list": + logger.info(f"Processing Mdblist.com List: {data}") + return [(i["imdb_id"], "imdb") for i in self.config.get_json(data,headers=headers)] + else: + raise Failed(f"Mdblist Error: Method {method} not supported")