Install: Plex Autoscan
Plex Autoscan (by l3uddz) is a script that assists Plex with the adding media files, that were imported by Sonarr / Radarr, by only scanning the folder that has been imported (vs the entire section library folder), thereby preventing Google API bans.
Plex Autoscan comes configured out of the box (as related to Cloudbox). However, there a few things that need to be set by you.
If you would like to learn more about what Plex Autoscan does and all the options available, visit https://github.com/l3uddz/plex_autoscan.
1. Do a One-Time, Manual Scan in Plex
For Plex Autoscan to work, at least one item needs to exist in each library before new items can show up.
If you already have media, simply add it to the library and do a manual scan within Plex, for each library you have, to build the DB.
If you currently don’t have any media, continue on with the setup, and when you have acquired some media, you will then perform a do a manual scan within Plex, for each library, to build the DB.
For more info, see this.
2. Add Your Plex Access Token into Plex Autoscan Config
You can skip this step if you entered in your Plex credentials in accounts.yml during setup.
Note: For Mediabox / Feederbox setups, the following will be done on the Mediabox.
Get your Plex Autoscan Token here.
On the server's shell, run the following command:
Add the Plex Access Token to
"PLEX_TOKEN":so that it now appears as:
Note: Make sure it is within the quotes (
") and there is a comma (
,) after it.
Ctrl + X Y Enter to save.
3. Obtaining the Plex Autoscan URL
Note: For Mediabox / Feederbox setup, the following will be done on the Mediabox.
To get your Plex Autoscan URL, run the following command:
This will be in the format of:
Note 1: The url will not use plex.domain.com if the IP address it points to does not match the server's IP address (e.g. Cloudflare CDN enabled).
Note 2: If the url is plex.domain.com, but you decide to enable Cloudflare proxy for the
plex subdomain later, you will need to generate another Plex Autoscan URL and add that into Sonarr/Radarr/Lidarr instead, as the scan request will need to go to you server's actual IP and not a Cloudflare one.
Note 3: For Mediabox setups, make sure that the port is open in the firewall and/or router.
Note 4: The PAS URL is not meant to be accessed via a browser by default (i.e. going there will give you a
401 Unauthorized error). However, you can enable a web UI for manual scan requests, see here.
4. Upload Control File to Google Drive
The following step is important so that Plex Autoscan can remove missing/replaced media files out of Plex (i.e. empty trash). Without it, Plex will be left with "unavailable" media that can't play (i.e. media posters with trash icons on them).
For more details on what the control file is, see here.
To upload the mounted.bin control file, run the following command:
rclone touch google:/mounted.bin
Note 1: If your Rclone remote config has a different name for Google Drive, replace
google: with yours'.
Note 2: Above command requires Rclone version 1.39+