Install: Plex Autoscan - dibrz/ARMBand GitHub Wiki

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 Manual Scan in Plex, Once

  • For Plex Autoscan to work, at least one item needs to exist in each library before new items can show up.

  • So, after adding something to each library, you will need to perform a single, manual scan in Plex.

  • For more info, see this.

2. Obtain a Plex Access Token

3. Add the Plex Access Token into Plex Autoscan

  1. On the server's shell, run the following command:

    nano /opt/plex_autoscan/config/config.json
    
  2. Add the Plex Access Token to "PLEX_TOKEN": so that it now appears as:

    "PLEX_TOKEN": "xxxxxxxxxxxxxx",
    

    Note: Make sure it is within the quotes (") and there is a comma (,) after it.

  3. Ctrl + X Y Enter to save.

Note: For Mediabox/Feederbox setups, do this on the Mediabox.

4. Obtaining the Plex Autoscan URL

The Plex Autoscan URL is needed during the setup of Sonarr and Radarr.

To get your Plex Autoscan URL, run the following command:

/opt/scripts/plex_autoscan/plex_autoscan_url.sh

This will be in the format of:

http://subdomain.domain.com:plex_autoscan_port/plex_autoscan_pass

or

http://server_ip_address:plex_autoscan_port/plex_autoscan_pass

Example:

http://plex.domain.com:3468/aiG7Uwie9iodTTlaisahcieNaeVonu6I

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: For Mediabox/Feederbox setups, do this on the Mediabox. Also make sure that the port is open in the Mediabox's firewall and/or router.

5. 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+


Credit:
1 https://github.com/wernight
2 https://github.com/jacobwgillespie

⚠️ **GitHub.com Fallback** ⚠️