The Powershell Movie Companion Script.
Popcorn can be used to add trailers to your movie collection, fix naming errors and it can also be triggered by Radarr to keep your trailers up to date with your recent additions.
Popcorn was forked from trailers.ps1 by James Ashwin.
- Powershell 5+
- A movie library with the naming convention {Movie Title} ({Release Year}), example: Fall Guy (2024).
- Download the script in a directory of your choice.
If you want to connect it to Radarr make sure it is in a directory that is visible to your Radarr installation. - Open Powershell and navigate to the directory you saved Popcorn in.
- Run the following command
./popcorn install - Now you will need to edit the settings.
Run the following command./popcorn edit - You must change the following settings for Popcorn to work:
$libraryRoot = "C:\Your\Movie\Collection"
Change C:\Your\Movie\Collection to the parent directory of your movie collection.$ytdlpCookies = "edge"
Change this to whatever browser would have your YouTube/Google Cookies.
YT-DLP currently supports cookies from the following browsers:
brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale.$tmdbApiKey = "TMDB-API-KEY"
Replace your 'TMDB-API-KEY' with your API Key from TMDB.
This is required for the script to function.
If you do not have one, please visit this website to create one: https://www.themoviedb.org/settings/api/request$googleApiKey = "GOOGLE-API-KEY"
Replace your 'GOOGLE-API-KEY' with your API Key from Google.
Make sure it has access to the 'YouTube V3 API' at minimum.
It is required for the script to function.
If you do not have one, please visit this website to create one: https://developers.google.com/workspace/guides/create-credentials#api-key
- Press
CTRL+Oto save then pressCTRL-Xto exit. - Popcorn is now ready to use. ⭐
- Open a PowerShell window.
- Navigate to the installation folder.
- Run the following command
./popcorn trailers - Wait for the script to finish.
- If you receive any Invalid Name Format errors run the following command
./popcorn fixthen run./popcorn trailersagain. - The first run will take a little bit of time depending on the size of your collection.
- You can monitor download progress in the Powershell window or in the most recent log file.
- Open Radarr
- Create a new Connection
- Go to 'Settings', 'Connect', '+' and select 'Custom Script'.
- Set the Notification Triggers to 'On Import' and 'On Rename'.
- Set the path to your copy of popcorn.ps1.
- Test the Connection.
- Save the Connection.
./popcorn fixScan the library and attempt to fix any invalid naming formats found../popcorn editLaunch Nano so you can edit the script../popcorn helpDisplays the Help dialog../popcorn aboutDisplays the About dialog../popcorn installInstall the dependencies via Chocolatey Package Manager. If you don't have Chocolatey it will be installed along with FFMPEG, YT-DLP and Nano../popcorn trailersScan the library and download trailers for the movies found.