mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
[10] adds reciperr_list builder
This commit is contained in:
parent
e5f0bea8d6
commit
06336caef4
11 changed files with 86 additions and 38 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.16.2-develop9
|
||||
1.16.2-develop10
|
||||
|
|
|
@ -182,6 +182,7 @@ html_theme_options = {
|
|||
("Letterboxd Builders", "metadata/builders/letterboxd"),
|
||||
("ICheckMovies Builders", "metadata/builders/icheckmovies"),
|
||||
("FlixPatrol Builders", "metadata/builders/flixpatrol"),
|
||||
("Reciperr Builders", "metadata/builders/reciperr"),
|
||||
("StevenLu Builders", "metadata/builders/stevenlu"),
|
||||
("AniDB Builders", "metadata/builders/anidb"),
|
||||
("AniList Builders", "metadata/builders/anilist"),
|
||||
|
|
|
@ -22,7 +22,7 @@ The available attributes for the operations attribute are as follows
|
|||
| `delete_collections_with_less` | Deletes every collection with less than the given number of items.<br>**Values:** number greater then 0 |
|
||||
| `delete_unmanaged_collections` | Deletes every unmanaged collection<br>**Values:** `true` or `false` |
|
||||
| `mass_genre_update` | Updates every item's genres in the library to the chosen site's genres<br>**Values:** <table class="clearTable"><tr><td>`tmdb`</td><td>Use TMDb for Genres</td></tr><tr><td>`tvdb`</td><td>Use TVDb for Genres</td></tr><tr><td>`omdb`</td><td>Use IMDb through OMDb for Genres</td></tr><tr><td>`anidb`</td><td>Use AniDB Tags for Genres</td></tr></table> |
|
||||
| `mass_content_rating_update` | Updates every item's content rating in the library to the chosen site's genres<br>**Values:** <table class="clearTable"><tr><td>`mdb`</td><td>Use MdbList for Content Ratings</td></tr><tr><td>`mdb_commonsense`</td><td>Use Commonsense Rating through MDbList for Content Ratings</td></tr><tr><td>`omdb`</td><td>Use IMDb through OMDb for Content Ratings</td></tr></table> |
|
||||
| `mass_content_rating_update` | Updates every item's content rating in the library to the chosen site's content rating<br>**Values:** <table class="clearTable"><tr><td>`mdb`</td><td>Use MdbList for Content Ratings</td></tr><tr><td>`mdb_commonsense`</td><td>Use Commonsense Rating through MDbList for Content Ratings</td></tr><tr><td>`omdb`</td><td>Use IMDb through OMDb for Content Ratings</td></tr></table> |
|
||||
| `mass_originally_available_update` | Updates every item's originally available date in the library to the chosen site's date<br>**Values:** <table class="clearTable"><tr><td>`tmdb`</td><td>Use TMDb Release Date</td></tr><tr><td>`tvdb`</td><td>Use TVDb Release Date</td></tr><tr><td>`omdb`</td><td>Use IMDb Release Date through OMDb</td></tr><tr><td>`mdb`</td><td>Use MdbList Release Date</td></tr><tr><td>`anidb`</td><td>Use AniDB Release Date</td></tr></table> |
|
||||
| `mass_audience_rating_update`/<br>`mass_critic_rating_update` | Updates every item's audience/critic rating in the library to the chosen site's rating<br>**Values:** <table class="clearTable"><tr><td>`tmdb`</td><td>Use TMDb Rating</td></tr><tr><td>`omdb`</td><td>Use IMDbRating through OMDb</td></tr><tr><td>`mdb`</td><td>Use MdbList Score</td></tr><tr><td>`mdb_imdb`</td><td>Use IMDb Rating through MDbList</td></tr><tr><td>`mdb_metacritic`</td><td>Use Metacritic Rating through MDbList</td></tr><tr><td>`mdb_metacriticuser`</td><td>Use Metacritic User Rating through MDbList</td></tr><tr><td>`mdb_trakt`</td><td>Use Trakt Rating through MDbList</td></tr><tr><td>`mdb_tomatoes`</td><td>Use Rotten Tomatoes Rating through MDbList</td></tr><tr><td>`mdb_tomatoesaudience`</td><td>Use Rotten Tomatoes Audience Rating through MDbList</td></tr><tr><td>`mdb_tmdb`</td><td>Use TMDb Rating through MDbList</td></tr><tr><td>`mdb_letterboxd`</td><td>Use Letterboxd Rating through MDbList</td></tr><tr><td>`anidb_rating`</td><td>Use AniDB Rating</td></tr><tr><td>`anidb_average`</td><td>Use AniDB Average</td></tr></table> |
|
||||
| `mass_imdb_parental_labels` | Updates every item's labels in the library to match the IMDb Parental Guide<br>**Values** `with_none` or `without_none` |
|
||||
|
|
25
docs/metadata/builders/reciperr.md
Normal file
25
docs/metadata/builders/reciperr.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Reciperr Builders
|
||||
|
||||
You can find movies using a Reciperr list on [reciperr.com](https://reciperr.com/) (Reciperr).
|
||||
|
||||
No configuration is required for this builder.
|
||||
|
||||
| Attribute | Description | Works with Movies | Works with Shows | Works with Playlists and Custom Sort |
|
||||
|:----------------------------------|:-----------------------------------------------|:-----------------:|:----------------:|:------------------------------------:|
|
||||
| [`reciperr_list`](#reciperr-list) | Finds every movie at a Reciperr JSON data URL. | ✅ | ❌ | ✅ |
|
||||
|
||||
## Reciperr List
|
||||
|
||||
Finds every movie on Reciperr a list.
|
||||
|
||||
The expected input is the url that points to the JSON data or a list of urls that do.
|
||||
|
||||
The `sync_mode: sync` and `collection_order: custom` Details are recommended since the lists are continuously updated and in a specific order.
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
Reciperr Movies:
|
||||
reciperr_list: https://reciperr.com/api/recipe/list/params?recipeMetadataId=62354f0e89a919001d650fa3
|
||||
collection_order: custom
|
||||
sync_mode: sync
|
||||
```
|
|
@ -1,6 +1,6 @@
|
|||
import 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, mdblist, util
|
||||
from modules import anidb, anilist, flixpatrol, icheckmovies, imdb, letterboxd, mal, plex, radarr, reciperr, sonarr, 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
|
||||
|
@ -71,13 +71,13 @@ 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 + \
|
||||
letterboxd.builders + mal.builders + plex.builders + reciperr.builders + tautulli.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",
|
||||
"tmdb_collection", "tmdb_collection_details", "tmdb_movie", "tmdb_movie_details", "tmdb_now_playing",
|
||||
"tvdb_movie", "tvdb_movie_details", "trakt_boxoffice"
|
||||
"tvdb_movie", "tvdb_movie_details", "trakt_boxoffice", "reciperr_list"
|
||||
]
|
||||
music_only_builders = ["item_album_sorting"]
|
||||
summary_details = [
|
||||
|
@ -170,7 +170,7 @@ smart_invalid = ["collection_order", "collection_level"]
|
|||
smart_url_invalid = ["minimum_items", "filters", "run_again", "sync_mode", "show_filtered", "show_missing", "save_missing", "smart_label"] + radarr_details + sonarr_details
|
||||
custom_sort_builders = [
|
||||
"plex_search", "plex_pilots", "tmdb_list", "tmdb_popular", "tmdb_now_playing", "tmdb_top_rated",
|
||||
"tmdb_trending_daily", "tmdb_trending_weekly", "tmdb_discover",
|
||||
"tmdb_trending_daily", "tmdb_trending_weekly", "tmdb_discover", "reciperr_list",
|
||||
"tvdb_list", "imdb_chart", "imdb_list", "stevenlu_popular", "anidb_popular",
|
||||
"trakt_list", "trakt_watchlist", "trakt_collection", "trakt_trending", "trakt_popular", "trakt_boxoffice",
|
||||
"trakt_collected_daily", "trakt_collected_weekly", "trakt_collected_monthly", "trakt_collected_yearly", "trakt_collected_all",
|
||||
|
@ -640,8 +640,8 @@ class CollectionBuilder:
|
|||
self._mal(method_name, method_data)
|
||||
elif method_name in plex.builders or method_final in plex.searches:
|
||||
self._plex(method_name, method_data)
|
||||
elif method_name in stevenlu.builders:
|
||||
self._stevenlu(method_name, method_data)
|
||||
elif method_name in reciperr.builders:
|
||||
self._reciperr(method_name, method_data)
|
||||
elif method_name in tautulli.builders:
|
||||
self._tautulli(method_name, method_data)
|
||||
elif method_name in tmdb.builders:
|
||||
|
@ -1145,8 +1145,12 @@ class CollectionBuilder:
|
|||
else:
|
||||
self.builders.append(("plex_search", self.build_filter("plex_search", {"any": {method_name: method_data}})))
|
||||
|
||||
def _stevenlu(self, method_name, method_data):
|
||||
self.builders.append((method_name, util.parse(self.Type, method_name, method_data, "bool")))
|
||||
def _reciperr(self, method_name, method_data):
|
||||
if method_name == "reciperr_list":
|
||||
for reciperr_list in self.config.Reciperr.validate_list(method_data):
|
||||
self.builders.append((method_name, reciperr_list))
|
||||
elif method_name == "stevenlu_popular":
|
||||
self.builders.append((method_name, util.parse(self.Type, method_name, method_data, "bool")))
|
||||
|
||||
def _mdblist(self, method_name, method_data):
|
||||
for mdb_dict in self.config.Mdblist.validate_mdblist_lists(self.Type, method_data):
|
||||
|
@ -1339,15 +1343,15 @@ class CollectionBuilder:
|
|||
elif "imdb" in method:
|
||||
ids = self.config.IMDb.get_imdb_ids(method, value, self.language)
|
||||
elif "flixpatrol" in method:
|
||||
ids = self.config.FlixPatrol.get_flixpatrol_ids(method, value, self.language, self.library.is_movie)
|
||||
ids = self.config.FlixPatrol.get_tmdb_ids(method, value, self.language, self.library.is_movie)
|
||||
elif "icheckmovies" in method:
|
||||
ids = self.config.ICheckMovies.get_icheckmovies_ids(method, value, self.language)
|
||||
ids = self.config.ICheckMovies.get_imdb_ids(method, value, self.language)
|
||||
elif "letterboxd" in method:
|
||||
ids = self.config.Letterboxd.get_tmdb_ids(method, value, self.language)
|
||||
elif "stevenlu" in method:
|
||||
ids = self.config.StevenLu.get_stevenlu_ids(method)
|
||||
elif "reciperr" in method or "stevenlu" in method:
|
||||
ids = self.config.Reciperr.get_imdb_ids(method, value)
|
||||
elif "mdblist" in method:
|
||||
ids = self.config.Mdblist.get_mdblist_ids(method, value)
|
||||
ids = self.config.Mdblist.get_imdb_ids(method, value)
|
||||
elif "tmdb" in method:
|
||||
ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie)
|
||||
elif "trakt" in method:
|
||||
|
|
|
@ -18,7 +18,7 @@ from modules.omdb import OMDb
|
|||
from modules.plex import Plex
|
||||
from modules.radarr import Radarr
|
||||
from modules.sonarr import Sonarr
|
||||
from modules.stevenlu import StevenLu
|
||||
from modules.reciperr import Reciperr
|
||||
from modules.mdblist import Mdblist
|
||||
from modules.tautulli import Tautulli
|
||||
from modules.tmdb import TMDb
|
||||
|
@ -541,7 +541,7 @@ class ConfigFile:
|
|||
self.FlixPatrol = FlixPatrol(self)
|
||||
self.ICheckMovies = ICheckMovies(self)
|
||||
self.Letterboxd = Letterboxd(self)
|
||||
self.StevenLu = StevenLu(self)
|
||||
self.Reciperr = Reciperr(self)
|
||||
|
||||
logger.separator()
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class FlixPatrol:
|
|||
else:
|
||||
raise Failed(f"FlixPatrol Error: Method {method} not supported")
|
||||
|
||||
def get_flixpatrol_ids(self, method, data, language, is_movie):
|
||||
def get_tmdb_ids(self, method, data, language, is_movie):
|
||||
if method == "flixpatrol_demographics":
|
||||
logger.info("Processing FlixPatrol Demographics:")
|
||||
logger.info(f"\tGeneration: {generations_pretty[data['generation']]}")
|
||||
|
|
|
@ -35,7 +35,7 @@ class ICheckMovies:
|
|||
raise Failed(f"ICheckMovies Error: {list_url} failed to parse")
|
||||
return valid_lists
|
||||
|
||||
def get_icheckmovies_ids(self, method, data, language):
|
||||
def get_imdb_ids(self, method, data, language):
|
||||
if method == "icheckmovies_list":
|
||||
logger.info(f"Processing ICheckMovies List: {data}")
|
||||
return self._parse_list(data, language)
|
||||
|
|
|
@ -158,7 +158,7 @@ class Mdblist:
|
|||
valid_lists.append({"url": mdb_url, "limit": list_count, "sort_by": sort_by})
|
||||
return valid_lists
|
||||
|
||||
def get_mdblist_ids(self, method, data):
|
||||
def get_imdb_ids(self, method, data):
|
||||
if method == "mdblist_list":
|
||||
logger.info(f"Processing Mdblist.com List: {data['url']}")
|
||||
logger.info(f"Sort By: {data['sort_by']}")
|
||||
|
|
36
modules/reciperr.py
Normal file
36
modules/reciperr.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from modules import util
|
||||
from modules.util import Failed
|
||||
|
||||
logger = util.logger
|
||||
|
||||
builders = ["reciperr_list", "stevenlu_popular"]
|
||||
|
||||
stevenlu_url = "https://s3.amazonaws.com/popular-movies/movies.json"
|
||||
|
||||
class Reciperr:
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
|
||||
def _request(self, url, name="Reciperr"):
|
||||
response = self.config.get(url)
|
||||
if response.status_code >= 400:
|
||||
raise Failed(f"{name} Error: JSON not found at {url}")
|
||||
return response.json()
|
||||
|
||||
def validate_list(self, data):
|
||||
valid_lists = []
|
||||
for reciperr_list in util.get_list(data, split=False):
|
||||
if "imdb_id" not in self._request(reciperr_list)[0]:
|
||||
raise Failed(f"Reciperr Error: imdb_id not found in the JSON at {reciperr_list}")
|
||||
valid_lists.append(reciperr_list)
|
||||
return valid_lists
|
||||
|
||||
def get_imdb_ids(self, method, data):
|
||||
if method == "reciperr_list":
|
||||
logger.info(f"Processing Reciperr Movies")
|
||||
return [(i["imdb_id"], "imdb") for i in self._request(data)]
|
||||
elif method == "stevenlu_popular":
|
||||
logger.info(f"Processing StevenLu Popular Movies")
|
||||
return [(i["imdb_id"], "imdb") for i in self._request(stevenlu_url, name="StevenLu")]
|
||||
else:
|
||||
raise Failed(f"Reciperr Error: Method {method} not supported")
|
|
@ -1,18 +0,0 @@
|
|||
from modules import util
|
||||
from modules.util import Failed
|
||||
|
||||
logger = util.logger
|
||||
|
||||
builders = ["stevenlu_popular"]
|
||||
base_url = "https://s3.amazonaws.com/popular-movies/movies.json"
|
||||
|
||||
class StevenLu:
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
|
||||
def get_stevenlu_ids(self, method):
|
||||
if method == "stevenlu_popular":
|
||||
logger.info(f"Processing StevenLu Popular Movies")
|
||||
return [(i["imdb_id"], "imdb") for i in self.config.get_json(base_url)]
|
||||
else:
|
||||
raise Failed(f"StevenLu Error: Method {method} not supported")
|
Loading…
Reference in a new issue