Skip to content

Automated poster maker for Plex. (PPM)

Notifications You must be signed in to change notification settings

cyb3rgh05t/posterizarr

 
 

Repository files navigation



This PowerShell script automates the process of generating images for your Plex media library. Leveraging information from your Plex library, such as movie or show titles, season and episode data, it fetches relevant artwork from Fanart.tv, TMDB, TVDB, Plex and IMDB. The script is able to focus on artwork with specific languages to grab. By default, textless artwork xx is retrieved and will fall back to en if textless is not found. This is a setting a user can decide on, either to focus on textless or on text posters. It also offers both automatic and manual modes for generating posters. The manual mode can accommodate custom creations that cannot be bulk retrieved.

Note

Posterizarr is cross-platform ready, meaning it can run on Linux, Docker (Alpine v3.17) and on Windows operating systems.

Supported Poster Types:

  • Movie/Show Posters
  • Movie/Show Backgrounds
  • Season Posters
  • TitleCards

Tip

Here is an installation walkthrough

Warning

  • The temp Folder gets cleared on every Script run, so do not put files into it.
  • Apprise integration only works in docker container, please use discord on other platforms (discord also works on docker).
  • Please start the script as Admin on first run, otherwise the script is not able to install the prerequisites.

Key Features:

Tip

If you want to use the created assets with PMM make sure to check out the Assets doc

You can find an example config for the Assets on my PMM-Configs repo

  • Resizing: It automatically resizes every poster to 2000x3000.

  • Overlays: If you choose to, downloaded images will automatically have borders, text, and a gradient overlay applied.

    • Here are some gradient overlays that you can use instead of the default one gradient-zip
  • Automatic Library Search: The script autonomously searches for libraries within your Plex server, enhancing its usability.

  • Handling Multiple Versions: It adeptly manages multiple versions of a movie/show, ensuring comprehensive coverage.

  • CSV Export: Produces an impressive CSV file containing all queried movie/show information during the script's runtime in $ScriptRoot\logs\PlexLibexport.csv

  • Logging Capabilities: Records valuable information to a file in $ScriptRoot\logs\Scriptlog.log, facilitating troubleshooting and analysis.

    • It also generates a log with the output of every imagemagick command $ScriptRoot\logs\ImageMagickCommands.log.
    • Additionally, an ImageChoices.csv file is generated to store all the selected download options and essential information.
    • Send notification via apprise or discord Click here for Example pictures..
  • Cross-platform Compatibility: Ensures seamless operation across Linux, Docker, and Windows Plex servers, enhancing versatility.

  • Poster/Background/TitleCard Creation: It searches fanart/tmdb/tvdb/Plex for posters/backgrounds/titlecards and resizes the downloaded image to 3840x2160 (for titlecards and backgrounds) or 2000x3000 (for posters), fallback is grabbing artwork from imdb.

Note

Upon initial execution, the script may take some time to run as it compiles necessary data. Subsequent runs will look at whether a poster in the AssetPath is missing and only create missing posters, bypassing existing assets in the directory. If you are unhappy with the downloaded artwork, delete it in the AssetPath directory, rerun and the script will populate the missing artwork.

Important

Requirements:

Before utilizing the script, ensure the following prerequisites are installed and configured:

  • TMDB API Read Access Token: Obtain TMDB API Token - NOTE the TMDB API Read Access Token is the really, really long one
  • Fanart Personal API Key: Obtain Fanart API Key
  • TVDB API Key: Obtain TVDB API Key - Do not use "Legacy API Key", it only works with a Project Api Key.
  • ImageMagick: - Version 7.x is required - The script handles downloading and using a portable version of ImageMagick for all platforms. (You may need to run the Script as Admin on first run). If you prefer to reference your own installation or prefer to download and install it yourself, goto: Download ImageMagick
  • Powershell Version: 5.x or higher (Docker Image uses v7.4.1).

Configuration:

  1. Open config.example.json located in the script directory.

  2. Update the following variables with your API keys and preferences:

    ApiPart:
    • tvdbapi: Your TVDB Project API key.
    • tmdbtoken: Your TMDB API Read Access Token.
    • FanartTvAPIKey: Your Fanart personal API key.
    • PlexToken: Your Plex token (Leave empty if not applicable).
    • FavProvider: Set your preferred provider (default is tmdb).
      • possible values are:
        • tmdb
        • fanart
        • tvdb
        • plex
    • PreferredLanguageOrder: Specify language preferences. Default is xx,en,de (xx is Textless). Example configurations can be found in the config file. 2-digit language codes can be found here: ISO 3166-1 Lang Codes.
    • PreferredSeasonLanguageOrder: Specify language preferences for seasons. Default is xx,en,de (xx is Textless). Example configurations can be found in the config file. 2-digit language codes can be found here: ISO 3166-1 Lang Codes.
    PlexPart:
    Notification:
    • SendNotification: Set to true if you want to send notifications via discord or apprise, else false.
    • AppriseUrl: Only possible on Docker -Url for apprise provider -> See Docs.
    • Discord: Discord Webhook Url.
    PrerequisitePart:
    • AssetPath: Path to store generated posters.
    • show_skipped: If set to true, verbose logging of already created assets will be displayed; otherwise, they will be silently skipped - On large libraries, this may appear as if the script is hanging.
    • magickinstalllocation: Path to ImageMagick installation location where magick.exe is located (Otherwise leave value as "./magick")
      • The container handles this part on his own, you can leave it as it is in config.
    • maxLogs: Number of Log folders you want to keep in RotatedLogs Folder (Log History).
    • logLevel: Sets the verbosity of logging. 1 logs Warning/Error messages. Default is 2 which logs Info/Warning/Error messages. 3 captures Info/Warning/Error/Debug messages and is the most verbose.
    • font: Font file name.
    • backgroundfont: Background font file name.
    • overlayfile: Overlay file name.
    • backgroundoverlayfile: Background overlay file name.
    • titlecardoverlayfile : Title Card overlay file name.
    • LibraryFolders: Set to false for asset structure in one flat folder or true to split into library media folders like Plex-Meta-Manager needs it.
    • Posters: Set to true to create movie/show posters.
    • SeasonPosters: Set to true to also create season posters.
    • BackgroundPosters: Set to true to also create background posters.
    • TitleCards : Set to true to also create title cards.
    OverlayPart:
    • ImageProcessing: Set to true if you want the ImageMagick part; if false, it only downloads the posters.
    • outputQuality: Image output quality, default is 92% if you set it to 100% the image size gets doubled.
    PosterOverlayPart:
    • fontAllCaps: Set to true for all caps text, else false.
    • AddBorder: Set to true to add a border to the image.
    • AddText: Set to true to add text to the image.
    • AddOverlay: Set to true to add the defined overlay file to the image.
    • fontcolor: Color of font text.
    • bordercolor: Color of border.
    • minPointSize: Minimum size of text in poster.
    • maxPointSize: Maximum size of text in poster.
    • borderwidth: Border width.
    • MaxWidth: Maximum width of text box.
    • MaxHeight: Maximum height of text box.
    • text_offset: Text box offset from the bottom of the picture.
    SeasonPosterOverlayPart:
    • fontAllCaps: Set to true for all caps text, else false.
    • AddBorder: Set to true to add a border to the image.
    • AddText: Set to true to add text to the image.
    • AddOverlay: Set to true to add the defined overlay file to the image.
    • fontcolor: Color of font text.
    • bordercolor: Color of border.
    • minPointSize: Minimum size of text in poster.
    • maxPointSize: Maximum size of text in poster.
    • borderwidth: Border width.
    • MaxWidth: Maximum width of text box.
    • MaxHeight: Maximum height of text box.
    • text_offset: Text box offset from the bottom of the picture.
    BackgroundOverlayPart:
    • fontAllCaps: Set to true for all caps text, else false.
    • AddBorder: Set to true to add a border to the background image.
    • AddText: Set to true to add text to the background image.
    • AddOverlay: Set to true to add the defined background overlay file to the background image.
    • fontcolor: Color of font text.
    • bordercolor: Color of border.
    • minPointSize: Minimum size of text in background image.
    • maxPointSize: Maximum size of text in background image.
    • borderwidth: Border width.
    • MaxWidth: Maximum width of text box in background image.
    • MaxHeight: Maximum height of text box in background image.
    • text_offset: Text box offset from the bottom of the background image.
    TitleCardOverlayPart:
    • UseBackgroundAsTitleCard: Set to true if you prefer show background as TitleCard, default is false where it uses episode image as TitleCard.
    • AddOverlay: Set to true to add the defined TitleCard overlay file to the TitleCard image.
    • AddBorder: Set to true to add a border to the TitleCard image.
    • borderwidth: Border width.
    • bordercolor: Color of border.
    TitleCardTitleTextPart:
    • AddEPTitleText: Set to true to add episode title text to the TitleCard image.
    • fontAllCaps: Set to true for all caps text, else false.
    • fontcolor: Color of font text.
    • minPointSize: Minimum size of text in TitleCard image.
    • maxPointSize: Maximum size of text in TitleCard image.
    • MaxWidth: Maximum width of text box in TitleCard image.
    • MaxHeight: Maximum height of text box in TitleCard image.
    • text_offset: Text box offset from the bottom of the TitleCard image.
    TitleCardEpisodeTextPart:
    • SeasonTCText: You can Specify the default text for Season that appears on TitleCard.
      • Example: STAFFEL 1 • EPISODE 5 or "SÄSONG 1 • EPISODE 1"
    • EpisodeTCText: You can Specify the default text for Episode that appears on TitleCard.
      • Example: SEASON 1 • EPISODE 5 or "SEASON 1 • AVSNITT 1"
    • fontAllCaps: Set to true for all caps text, else false.
    • AddEPText: Set to true to add episode text to the TitleCard image.
    • fontcolor: Color of font text.
    • minPointSize: Minimum size of text in TitleCard image.
    • maxPointSize: Maximum size of text in TitleCard image.
    • MaxWidth: Maximum width of text box in TitleCard image.
    • MaxHeight: Maximum height of text box in TitleCard image.
    • text_offset: Text box offset from the bottom of the TitleCard image.

  3. Rename the config file to config.json.

  4. Place the overlay.png, or whatever file you defined earlier in overlayfile, and Rocky.ttf font, or whatever font you defined earlier in font files in the same directory as Posterizarr.ps1 which is $ScriptRoot.

Usage:

  • Automatic Mode: Execute the script without any parameters to generate posters for your entire Plex library.
  • Testing Mode: Run the script with the -Testing switch to create Test posters before you start using it.
  • Manual Mode: Run the script with the -Manual switch to create custom posters manually.

Note

  • Ensure PowerShell execution policy allows script execution.
  • Bugs or issues encountered during usage can be reported for resolution.

Automatic Mode

Run the script without any parameters:

.\Posterizarr.ps1

This will generate posters for your entire Plex library based on the configured settings.

The posters are all placed in AssetPath\.... This can then be mounted in Plex-Meta-Manager to use as the assets folder.

Tautulli Mode Docker

Important

Tautulli and Posterizarr must run as a container in Docker

Note

If Discord is configured it will send a Notification on each trigger.

In this mode we use Tautulli to trigger Posterizarr for an specific item in Plex, like a new show, movie or episode got added.

To use it we need to configure a script in Tautulli, please follow these instructions.

  1. Make sure that you mount the Posterizarr directory to tautulli, cause the script needs the Path /posterizarr
    volumes:
      - "/opt/appdata/posterizarr:/posterizarr:rw"
  2. Download the trigger.py from the GH and place it in the Tautulli Script dir -> Tautulli-Wiki
  3. Open Tautulli and go to Settings -> NOTIFICATION AGENTS
  4. Click on Add a new notification agent and select Script
  5. Specify the script folder where you placed the script and select the script file.
    • You can specify a Description at the bottom like i did.
    🖼️Example

    testing

  6. Go to Triggers, scroll down and select Recently Added.
    🖼️Example

    testing

  7. Go to Conditions, you can now specify when the script should get called.
    • In my case i specified the Media Type: episode, movie, show and season
    • I also excluded the Youtube Lib cause the videos i have there - do not have an tmdb,tvdb or fanart ID.
      • This is an recommended setting, either exclude such libs or include only those libs where Posterizarr should create art for.
    🖼️Example

    testing

  8. Next go to Arguments -> Unfold Recently Added Menu and paste the following Argument, after that you can save it.
    • Please do not change the Argument otherwise the script could fail.
    <movie>RatingKey "{rating_key}" mediatype "{media_type}"</movie><show>grandparentratingkey "{grandparent_rating_key}" mediatype "{media_type}"</show><season>parentratingkey "{parent_rating_key}" grandparentratingkey "{grandparent_rating_key}" mediatype "{media_type}"</season><episode>RatingKey "{rating_key}" parentratingkey "{parent_rating_key}" grandparentratingkey "{grandparent_rating_key}" mediatype "{media_type}"</episode>
    🖼️Example

    testing

Testing Mode

Run the script with the -Testing flag. In this mode, the script will create pink posters/backgrounds with short, medium, and long texts (also in CAPS), using the values specified in the config.json file.

Tip

This is handy for testing your configuration before applying it en masse to the actual posters. You can see how and where the text would be applied, as well as the size of the textbox.

.\Posterizarr.ps1 -Testing

Docker

  • Docker-Compose Example File
    • Change RUN_TIME in yaml to your needs - You need to use 24H Time Format
      • The Script gets executed on the Times you specified
      • Before starting the scheduled run it checks if another Posterizarr process is running, if yes - the scheduled run will be skipped.
    • Change volume and network to fit your environment (Make sure you have the same network as your plex container when you use local IP of plex)
    • Change TimeZone to yours, otherwise it will get scheduled to a different time you may want it to.
    • You may also have to change PUID/PGID

Tip

If you are an unRAID user, install the Docker Compose Manager plugin from the Community Apps store so that you can leverage the compose file

If you manually want to run the Script you can do it this way:

Automatic Mode:

docker exec -it posterizarr pwsh Posterizarr.ps1

Testing Mode:

docker exec -it posterizarr pwsh Posterizarr.ps1 -Testing

Images from Testing Mode

🖼️Posters

testing

🖼️Backgrounds

backgroundtesting

🖼️TitleCards

titlecardtesting

Manual Mode

Important

Alpha and only tested on Windows.

Currently only movie/show/season poster creation integrated

Run the script with the -Manual switch:

.\Posterizarr.ps1 -Manual

Follow the prompts to enter the source picture path, media folder name, and movie/show title to manually create a custom poster.

How to create the Posterizarr.xlsm

📝Posterizarr Excel Creation using Module1.bas:
  1. Open Excel: First, open Microsoft Excel on your computer. You can do this by clicking on the Excel icon in your applications menu or by searching for "Excel" in your computer's search bar and selecting it from the results.

  2. Access the Visual Basic for Applications (VBA) Editor:

    • While in Excel, press Alt + F11 on your keyboard. This keyboard shortcut will open the VBA editor window.
  3. Import Module:

    • In the VBA editor window, you'll see a menu bar at the top.
    • Right-click on any existing module or in the project explorer (usually located on the left-hand side).
    • From the dropdown menu, select Import File....
    • A file explorer window will open. Navigate to the location where you saved the Module1.bas file.
    • Select the Module1.bas file and click Open.
  4. Run the Macro:

    • Now, go back to the Excel window.
    • Look for the View tab at the top of the Excel window.
    • Click on the View tab.
    • Within the Macros group, you'll find a button labeled Macros. Click on it.
    • In the dropdown menu, select View Macros.
    • A Macros dialog box will appear, listing all available macros.
    • In the list, you should see the PromptUser macro.
    • Select PromptUser from the list.
    • Finally, click the Run button.

Following these steps will allow you to import the Module1.bas file containing the VBA code into Excel and then run the PromptUser macro.

How to use the Posterizarr.xlsm

🎥Posterizarr Excel:

excel

Webhook

🖼️Discord Webhook:

webhook

Example Pictures:

🖼️ImageChoices.csv:

imagecsv

🖼️Assets after Posterizarr run:

output

🖼️Assets after PMM run:

imagecsv

Enjoy

Feel free to customize the script further to meet your specific preferences or automation requirements.

PR Rules

Important

  • Adjust on each PR the version number in script on Line 11 $CurrentScriptVersion = "1.0.55"
  • Adjust the version number in Release.txt to match the one in script.
    • this is required because the script checks against this file if a newer version is available.
  • Do not include images on a PR.

versioning

About

Automated poster maker for Plex. (PPM)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 97.2%
  • VBA 2.4%
  • Python 0.4%