While StreamFab has a Template for file names and such, it doesn't allow for all the options I want, and sometimes gets the resolution wrong. This Power Automate Desktop script uses MediaInfo CLI to capture the parameters of the file and sets variables that will be used in the file renaming process.
For my plex library I like to use the Edition tags, and capture what service the file was downloaded from, if its 4K and if it has HDR or not. I also use abbreviations for the services.
This flow meets my needs, and works, I've been using this for a long time, so I thought I'd share. I know there are other renamers out there, but I use Power Automate (cloud) for work so thought I'd play with Power Automate Desktop.
The script evaluates for video resolution of 2160, 1080, 720. It assumes progressive scan as everything I've downloaded has been progressive. It also evaluates HDR types of HDR10, DV, or DoVi HDR10 (which is DV with fall back to HDR10 included). Audio is evaluated for EAC3, EAC3 JOC, and AAC.
This script relies on StreamFab's VIP Services naming template for MOVIES to be:
<moviename> (<year>) {edition-}
Note: Peacock doesn't use StreamFab's name template currently, so I have separate rename steps for those files.
This script only looks at the top level of the Service Provider folder, it does not recurse subfolders. It does not touch already processed movies or touch TV shows as they would be in subfolders.
I have StreamFab set to download as MKV, so this script is set to work only on MKV files. If you download as MP4, you would need to make a few changes in the flow, where MKV is specifically called out (like steps 37, and 95-98)
What to expect:
Files downloaded at StreamFabOut\Amazon\MovieName (year) {edition-}.mkv will be renamed to StreamFabOut\Amazon\MovieName (year)\MovieName (year) 1080p {edition-Amz DL}.mkv
Similarly a 4K movie from Max with only HDR10, StreamFabOut\Max\MovieName (year) {edition-}.mkv will be renamed to StreamFabOut\Max\MovieName (year)\MovieName (year) 2160p {edition-Max DL 4K HDR10}.mkv
When copied to your Plex movie folder, they will show as the movie name, and the edition tag will be respected.
REQUIRED:
Personalization notes:
For my plex library I like to use the Edition tags, and capture what service the file was downloaded from, if its 4K and if it has HDR or not. I also use abbreviations for the services.
This flow meets my needs, and works, I've been using this for a long time, so I thought I'd share. I know there are other renamers out there, but I use Power Automate (cloud) for work so thought I'd play with Power Automate Desktop.
The script evaluates for video resolution of 2160, 1080, 720. It assumes progressive scan as everything I've downloaded has been progressive. It also evaluates HDR types of HDR10, DV, or DoVi HDR10 (which is DV with fall back to HDR10 included). Audio is evaluated for EAC3, EAC3 JOC, and AAC.
This script relies on StreamFab's VIP Services naming template for MOVIES to be:
<moviename> (<year>) {edition-}
Note: Peacock doesn't use StreamFab's name template currently, so I have separate rename steps for those files.
This script only looks at the top level of the Service Provider folder, it does not recurse subfolders. It does not touch already processed movies or touch TV shows as they would be in subfolders.
I have StreamFab set to download as MKV, so this script is set to work only on MKV files. If you download as MP4, you would need to make a few changes in the flow, where MKV is specifically called out (like steps 37, and 95-98)
What to expect:
Files downloaded at StreamFabOut\Amazon\MovieName (year) {edition-}.mkv will be renamed to StreamFabOut\Amazon\MovieName (year)\MovieName (year) 1080p {edition-Amz DL}.mkv
Similarly a 4K movie from Max with only HDR10, StreamFabOut\Max\MovieName (year) {edition-}.mkv will be renamed to StreamFabOut\Max\MovieName (year)\MovieName (year) 2160p {edition-Max DL 4K HDR10}.mkv
When copied to your Plex movie folder, they will show as the movie name, and the edition tag will be respected.
REQUIRED:
- Power Automate Desktop -> https://learn.microsoft.com/en-us/po...-flows/install
- MediaInfo CLI from -> https://mediaarea.net/en/MediaInfo/Download/Windows
- ONE TIME SETUP: With Power Automate Desktop Closed, download MediaInfo CLI, then unzip it, (move the folder if you need to) and add the folder to the Windows Path environment variable. To add to Path... Windows Settings -> System -> About -> Advanced System Settings -> Environment Variables. In the SYSTEM variables section, select Path, click the Edit Button, and add the folder where you unzipped MediaInfo CLI.
- Select this entire script in Post #2 of this thread, copy to the clipboard. Open Power Automate Desktop, Create a New Flow, name it, click Create. In the Main section (middle of screen), right click and paste. The flow steps will be created there. (if copy/paste of the "code" doesn't work, please see the attached text file, to copy/paste from)
- Make sure you set the FolderBase variable (lines 3-8 of the flow) in the Flow to match the top level if your StreamFab output folder. (also see personalization note below)
Personalization notes:
- I have both a laptop and desktop, the location of the download folders are different on each computer. Therefore I have a two sets of IF statements (rows 3 through 8) to evaluate if the folder exists and sets FolderBase = to the correct StreamFab output folder for the computer I'm working on.
- While I do have MediaInfo CLI capture video and audio details, I only use the video info when renaming. You can adjust rows 99-115 to include the Audio variable if you wish.
- Lines 15-34 set the custom Service names or abbreviations used when renaming the files. So if you don't like Amz for Amazon, edit line 16 for example.
- You don't need to have the edition tag in the final file name, You can tweak the output file name string and variables on rows 99-115.
Comment