|
|
@ -209,9 +209,9 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
@app.command(help='Add multiple shows to Sonarr.', context_settings=dict(max_content_width=100))
|
|
|
|
@app.command(help='Add multiple shows to Sonarr.', context_settings=dict(max_content_width=100))
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--list-type', '-t',
|
|
|
|
'--list-type', '-t',
|
|
|
|
help='Trakt list to process. '
|
|
|
|
help='Trakt list to process. \n'
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list',
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list.',
|
|
|
|
required=True)
|
|
|
|
required=True)
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--add-limit', '-l',
|
|
|
|
'--add-limit', '-l',
|
|
|
@ -232,6 +232,7 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
'--genre', '-g',
|
|
|
|
'--genre', '-g',
|
|
|
|
default=None,
|
|
|
|
default=None,
|
|
|
|
help='Only add shows from this genre to Sonarr. '
|
|
|
|
help='Only add shows from this genre to Sonarr. '
|
|
|
|
|
|
|
|
'Only one genre can be specified. \n'
|
|
|
|
'Use \'ignore\' to add shows from any genre, including ones with no genre specified.')
|
|
|
|
'Use \'ignore\' to add shows from any genre, including ones with no genre specified.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--folder', '-f',
|
|
|
|
'--folder', '-f',
|
|
|
@ -241,11 +242,12 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
'--actor', '-a',
|
|
|
|
'--actor', '-a',
|
|
|
|
default=None,
|
|
|
|
default=None,
|
|
|
|
help='Only add movies from this actor to Radarr. '
|
|
|
|
help='Only add movies from this actor to Radarr. '
|
|
|
|
|
|
|
|
'Only one actor can be specified. \n'
|
|
|
|
'Requires the \'person\' list option.')
|
|
|
|
'Requires the \'person\' list option.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
is_flag=True,
|
|
|
|
is_flag=True,
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. '
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. \n'
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--no-search',
|
|
|
|
'--no-search',
|
|
|
@ -257,7 +259,7 @@ def show(show_id, folder=None, no_search=False):
|
|
|
|
help='Send notifications.')
|
|
|
|
help='Send notifications.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--authenticate-user',
|
|
|
|
'--authenticate-user',
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. '
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. \n'
|
|
|
|
'Defaults to first user in the config')
|
|
|
|
'Defaults to first user in the config')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--ignore-blacklist',
|
|
|
|
'--ignore-blacklist',
|
|
|
@ -279,11 +281,14 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
|
|
|
|
|
|
|
|
added_shows = 0
|
|
|
|
added_shows = 0
|
|
|
|
|
|
|
|
|
|
|
|
# set special genre keyword 'ignore' if supplied
|
|
|
|
# process genre
|
|
|
|
if genre and genre.lower == 'ignore':
|
|
|
|
if genre:
|
|
|
|
|
|
|
|
# set special genre keyword to show's blacklisted_genres list
|
|
|
|
|
|
|
|
if genre.lower() == 'ignore':
|
|
|
|
cfg['filters']['shows']['blacklisted_genres'] = ['ignore']
|
|
|
|
cfg['filters']['shows']['blacklisted_genres'] = ['ignore']
|
|
|
|
# remove genre from shows blacklisted_genres if supplied
|
|
|
|
genre = None
|
|
|
|
elif genre:
|
|
|
|
# remove genre from show's blacklisted_genres list
|
|
|
|
|
|
|
|
else:
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['shows']['blacklisted_genres'])
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['shows']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
|
|
# replace sonarr root_folder if folder is supplied
|
|
|
|
# replace sonarr root_folder if folder is supplied
|
|
|
@ -304,16 +309,13 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
|
|
|
|
|
|
|
|
# get trakt series list
|
|
|
|
# get trakt series list
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows(genres=genre if genre and
|
|
|
|
trakt_objects_list = trakt.get_anticipated_shows(genres=genre,
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
trakt_objects_list = trakt.get_trending_shows(genres=genre if genre and
|
|
|
|
trakt_objects_list = trakt.get_trending_shows(genres=genre,
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
trakt_objects_list = trakt.get_popular_shows(genres=genre if genre and
|
|
|
|
trakt_objects_list = trakt.get_popular_shows(genres=genre,
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
if not actor:
|
|
|
|
if not actor:
|
|
|
@ -321,25 +323,21 @@ def shows(list_type, add_limit=0, add_delay=2.5, sort='votes', genre=None, folde
|
|
|
|
" list type!")
|
|
|
|
" list type!")
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
trakt_objects_list = trakt.get_person_shows(person=actor,
|
|
|
|
trakt_objects_list = trakt.get_person_shows(person=actor,
|
|
|
|
genres=genre if genre and
|
|
|
|
genres=genre,
|
|
|
|
'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
trakt_objects_list = trakt.get_recommended_shows(authenticate_user,
|
|
|
|
trakt_objects_list = trakt.get_recommended_shows(authenticate_user,
|
|
|
|
genres=genre if genre
|
|
|
|
genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
languages=cfg.filters.shows.allowed_languages)
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
trakt_objects_list = trakt.get_most_played_shows(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_most_played_shows(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
trakt_objects_list = trakt.get_most_watched_shows(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_most_watched_shows(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
languages=cfg.filters.shows.allowed_languages,
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
@ -550,9 +548,9 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
@app.command(help='Add multiple movies to Radarr.', context_settings=dict(max_content_width=100))
|
|
|
|
@app.command(help='Add multiple movies to Radarr.', context_settings=dict(max_content_width=100))
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--list-type', '-t',
|
|
|
|
'--list-type', '-t',
|
|
|
|
help='Trakt list to process. '
|
|
|
|
help='Trakt list to process. \n'
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
'For example, \'anticipated\', \'trending\', \'popular\', \'person\', \'watched\', \'played\', '
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list',
|
|
|
|
'\'recommended\', \'watchlist\', or any URL to a list.',
|
|
|
|
required=True)
|
|
|
|
required=True)
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--add-limit', '-l',
|
|
|
|
'--add-limit', '-l',
|
|
|
@ -577,6 +575,7 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
'--genre', '-g',
|
|
|
|
'--genre', '-g',
|
|
|
|
default=None,
|
|
|
|
default=None,
|
|
|
|
help='Only add movies from this genre to Radarr. '
|
|
|
|
help='Only add movies from this genre to Radarr. '
|
|
|
|
|
|
|
|
'Only one genre can be specified. \n'
|
|
|
|
'Use \'ignore\' to add movies from any genre, including ones with no genre specified.')
|
|
|
|
'Use \'ignore\' to add movies from any genre, including ones with no genre specified.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--folder', '-f',
|
|
|
|
'--folder', '-f',
|
|
|
@ -589,12 +588,13 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--actor', '-a',
|
|
|
|
'--actor', '-a',
|
|
|
|
default=None,
|
|
|
|
default=None,
|
|
|
|
help='Only add movies from this actor to Radarr. '
|
|
|
|
help='Only add movies from this actor to Radarr.'
|
|
|
|
|
|
|
|
'Only one actor can be specified. \n'
|
|
|
|
'Requires the \'person\' list.')
|
|
|
|
'Requires the \'person\' list.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
'--include-non-acting-roles',
|
|
|
|
is_flag=True,
|
|
|
|
is_flag=True,
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. '
|
|
|
|
help='Include non-acting roles such as \'As Himself\', \'Narrator\', etc. \n'
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
'Requires the \'person\' list option with the \'actor\' argument.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--no-search',
|
|
|
|
'--no-search',
|
|
|
@ -606,8 +606,8 @@ def movie(movie_id, folder=None, minimum_availability=None, no_search=False):
|
|
|
|
help='Send notifications.')
|
|
|
|
help='Send notifications.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--authenticate-user',
|
|
|
|
'--authenticate-user',
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. '
|
|
|
|
help='Specify which user to authenticate with to retrieve Trakt lists. \n'
|
|
|
|
'Default: first user in the config.')
|
|
|
|
'Defaults to first user in the config.')
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
'--ignore-blacklist',
|
|
|
|
'--ignore-blacklist',
|
|
|
|
is_flag=True,
|
|
|
|
is_flag=True,
|
|
|
@ -629,11 +629,14 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
|
|
|
|
|
|
|
|
added_movies = 0
|
|
|
|
added_movies = 0
|
|
|
|
|
|
|
|
|
|
|
|
# set special genre keyword 'ignore' if supplied
|
|
|
|
# process genre
|
|
|
|
if genre and genre.lower() == 'ignore':
|
|
|
|
if genre:
|
|
|
|
|
|
|
|
# set special genre keyword to movies's blacklisted_genres list
|
|
|
|
|
|
|
|
if genre.lower() == 'ignore':
|
|
|
|
cfg['filters']['movies']['blacklisted_genres'] = ['ignore']
|
|
|
|
cfg['filters']['movies']['blacklisted_genres'] = ['ignore']
|
|
|
|
# remove genre from movies blacklisted_genres if supplied
|
|
|
|
genre = None
|
|
|
|
elif genre:
|
|
|
|
# remove genre from movies's blacklisted_genres list
|
|
|
|
|
|
|
|
else:
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['movies']['blacklisted_genres'])
|
|
|
|
misc_helper.unblacklist_genres(genre, cfg['filters']['movies']['blacklisted_genres'])
|
|
|
|
|
|
|
|
|
|
|
|
# replace radarr root_folder if folder is supplied
|
|
|
|
# replace radarr root_folder if folder is supplied
|
|
|
@ -664,45 +667,39 @@ def movies(list_type, add_limit=0, add_delay=2.5, sort='votes', rating=None, gen
|
|
|
|
|
|
|
|
|
|
|
|
# get trakt movies list
|
|
|
|
# get trakt movies list
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
if list_type.lower() == 'anticipated':
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_anticipated_movies(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
elif list_type.lower() == 'trending':
|
|
|
|
trakt_objects_list = trakt.get_trending_movies(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_trending_movies(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
elif list_type.lower() == 'popular':
|
|
|
|
trakt_objects_list = trakt.get_popular_movies(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_popular_movies(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'boxoffice':
|
|
|
|
elif list_type.lower() == 'boxoffice':
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies()
|
|
|
|
trakt_objects_list = trakt.get_boxoffice_movies(genres=genre,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
elif list_type.lower() == 'person':
|
|
|
|
if not actor:
|
|
|
|
if not actor:
|
|
|
|
log.error("You must specify an actor with the \'--actor\' / \'-a\' parameter when using the \'person\'" +
|
|
|
|
log.error("You must specify an actor with the \'--actor\' / \'-a\' parameter when using the \'person\'" +
|
|
|
|
" list type!")
|
|
|
|
" list type!")
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
trakt_objects_list = trakt.get_person_movies(person=actor,
|
|
|
|
trakt_objects_list = trakt.get_person_movies(person=actor,
|
|
|
|
genres=genre if genre
|
|
|
|
genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
include_non_acting_roles=include_non_acting_roles)
|
|
|
|
|
|
|
|
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
elif list_type.lower() == 'recommended':
|
|
|
|
trakt_objects_list = trakt.get_recommended_movies(authenticate_user,
|
|
|
|
trakt_objects_list = trakt.get_recommended_movies(authenticate_user,
|
|
|
|
genres=genre if genre
|
|
|
|
genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
languages=cfg.filters.movies.allowed_languages)
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
elif list_type.lower().startswith('played'):
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
trakt_objects_list = trakt.get_most_played_movies(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_most_played_movies(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
elif list_type.lower().startswith('watched'):
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
most_type = misc_helper.substring_after(list_type.lower(), "_")
|
|
|
|
trakt_objects_list = trakt.get_most_watched_movies(genres=genre if genre
|
|
|
|
trakt_objects_list = trakt.get_most_watched_movies(genres=genre,
|
|
|
|
and 'ignore' not in genre.lower() else None,
|
|
|
|
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
languages=cfg.filters.movies.allowed_languages,
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
most_type=most_type if most_type else None)
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|
elif list_type.lower() == 'watchlist':
|
|
|
|