Plex AutoScan Highly Recommended - v2 | PlexGuide.com

Plex AutoScan Highly Recommended - v2

  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now

Admin9705

Administrator
Original poster
Project Manager
Donor
Jan 17, 2018
5,156
2,112
  • Like
Reactions: 1 user

stammbraeu

Experienced+
Staff
Donor
Mar 21, 2018
112
42
As the other thread has a bug a short summary for a working solution

NOTE: this solution is based on homer8798 - its not my solution

Attached you find a zipped folder "pgscan"

Copy the folder to:
/opt/plexguide/menu

You should end up with /opt/plexguide/menu/pgscan/

Code:
cd /opt/plexguide/menu/pgscan
sudo bash pgscan.sh
This starts the menu - here you go through the options:

1.) press 1
2..) press 2 ( values inside - follow text )
3.) press 3 ( values inside - follow text )
4.) press A ( for deploy )
5.) wait
6.) done

in the menu you should see now
Code:
PAS Webhook ARRs : [ http://plexautoscan:3468/YOURID]
Copy the url and use it to setup webhooks in sonarr/radarr/...

Setup of the webhooks:
Settings
Connect
new "Webhook"

Name: Whatever you want
On Grab: No
On Download: Yes
On Upgrade: Yes
On Rename: Yes
Filter... : empty
URL: you copied url from above
Method: Post
Username und Password: empty

Test and Save

From now on sonarr/radarr will tell plex about new library items without the need to scan for it

Important:
Deactivate library scans in plex
 

Attachments

  • Like
Reactions: 5 users

coltonomore

Citizen+
Jan 23, 2020
26
5
I used the above and it keeps saying the file doesnt exist

PLEX [140219197049632]: File '/mnt/unionfs/Movies/(I removed Movie Name)' did not exist on check 8 of 10. Checking again in 60 seconds...

it points to the direct path and it is there but it says it isnt. Any ideas?
 

Dexter.

Active
Donor
Jan 25, 2020
43
9
@stammbraeu
Thanks for this guide. I tried it before, but couldn't get it working. After some tests it seems to work fine now!
- in radarr/sonarr.. I turned off the other connect feature for plex media server which I had configured before (according the Plexguide Wiki)
- In Plex I also turn off partial scan. Is this correct?
 

pballs

Citizen+
Raffle Winner
Feb 12, 2020
19
3
@stammbraeu
Thanks for this guide. I tried it before, but couldn't get it working. After some tests it seems to work fine now!
- in radarr/sonarr.. I turned off the other connect feature for plex media server which I had configured before (according the Plexguide Wiki)
- In Plex I also turn off partial scan. Is this correct?
RE: radarr/sonnar - thats correct
and yes, switch of partial scan - plex_autoscan does all the work now
 
  • Like
Reactions: 1 user

AlexFields

Citizen+
Mar 22, 2019
19
11
@stammbraeu
Got it working. easy and fast.

Edit: Update.

So now its not working anymore.
When I excute thescript I removed everything again it says toked deployed but pass config missing.
Real strange removed the docker etc, everything. Whole new install but still.

Any tips guys ?
Post automatically merged:

Update:
I found the problem for the config pas missing.

The problem is the Plex Access Token. For some reason the script cant pull it up.
To fix this first find your access token manually by using the XML Method.
(https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/)

The go into the config JSON file.
Located at: opt/plexguide/menu/pgscan/templates/

FInd: "PLEX_TOKEN": "{{plex_auth_token.stdout}}",
Replace with your Token.

EXAMPLE: PLEX_TOKEN": "YOURTOKENHERE1234",

Just deploy after that even if it says missing.
Use Sonarr or Radarr to test it.

Next on my list is to get the teamdrives working reliable.
 
Last edited:
  • Like
Reactions: 1 user

Dexter.

Active
Donor
Jan 25, 2020
43
9
I have some problems when i download the same movie in 1080 and 4k. For this i have two different folders /movies and /movies4k. These folders are in the same Library "Movies" in Plex. Before I was using the script, it only showed the movie with one "cover" in the library and before I play it, I could choose which version to play (1080 or 4k). Now it always create a second "cover" in the library (1x 1080, 1x 4k) in the library.

I think it have something to do with this entry in the log:
2020-05-10 12:54:21,131 - INFO - PLEX [140]: Found 1 'media_items' with 'metadata_item_id' 1926 where folder does not match: '/mnt/unionfs/movies4k/Spenser Confidential (2020)'
2020-05-10 12:54:21,429 - INFO - PLEX [140]: Successfully split 'metadata_item_id': '1926'

So I think it have to do something with the "split" entry which the scanner does, because before it does the split, it is shown correctly in Plex. What is curious: This problem I only have with movies. For TV series i have the same configuration (seperated into "tv" and "tv4k") and it works perfectly.

It seems to work when I disable ("false") "PLEX_FIX_MISMATCHED". But sometimes this feature is really nice, because it happens very often that some movies are not recognized correctly in Plex.

Maybe someone have a idea how i could handle this differently?
 
Last edited:
  • Like
Reactions: 1 user

stammbraeu

Experienced+
Staff
Donor
Mar 21, 2018
112
42
why do you seperate them in folders but then unify them again in plex?

i would suggest to use a dedicated library for 4k
this way you can define with whom you want to share your 4k library - in my case i only share it with those who are capable of direct play

also for my mobile devices i have only enabled the 1080p library as it makes no sense to go 4k when im not home
 
  • Like
Reactions: 1 user

timekills

VIP
Staff
Donor
Sep 12, 2018
367
192
@homer8798 and stammbraeu, and others...thank you.
I have been semi-successful at the using the built-in updater of Plex from Sonarr/Radarr but after testing with a couple movie downloads I can confirm that it was *never* this quick to update Plex.
This was instantaneous. In the time it took me to switch tabs to plex (testing in browser for this - don't be a hater ;) ) and hit the refresh button on the home page it was already showing as available.
 

GrahamC7388

Noobz
Oct 13, 2019
2
0
Hi All, hoping I could lean on the community for some assistance in getting this set up. I downloaded and deployed the files from the zip successfully and am able to start a manual scan at the server website, and get successful tests from radarr and sonarr. When the scan kicks off, I end up with a 'file did not exist' error as below.

Code:
INFO -  AUTOSCAN [140704392674080]: Starting queue processor in 10 seconds...
2020-05-20 00:15:15,761 -     INFO -  AUTOSCAN [140704416980296]: Starting server: http://0.0.0.0:3468/(redacted)
2020-05-20 00:15:25,771 -     INFO -  AUTOSCAN [140704392674080]: Queue processor started.
2020-05-20 00:15:25,772 -     INFO -  AUTOSCAN [140704392674080]: Restored 0 scan request(s) from Plex Autoscan database.
2020-05-20 00:16:45,484 -     INFO -  AUTOSCAN [140704392674080]: Client '172.18.0.10' made a manual scan request for: '/mnt/unionfs/movies/22 Jump Street (2014)/'
2020-05-20 00:16:45,487 -     INFO -  AUTOSCAN [140704392674080]: Using Section ID '1' for '/mnt/unionfs/movies/22 Jump Street (2014)/'
2020-05-20 00:16:45,491 -     INFO -  AUTOSCAN [140704392674080]: Added '/mnt/unionfs/movies/22 Jump Street (2014)/' to Plex Autoscan database.
2020-05-20 00:16:45,491 -     INFO -  AUTOSCAN [140704392674080]: Proceeding with scan...
2020-05-20 00:16:45,491 -     INFO -      PLEX [140704391613216]: Scan request from Manual for '/mnt/unionfs/movies/22 Jump Street (2014)/'.
2020-05-20 00:16:45,492 -     INFO -      PLEX [140704391613216]: Sleeping for 15 seconds...
2020-05-20 00:17:00,501 -     INFO -      PLEX [140704391613216]: File '/mnt/unionfs/movies/22 Jump Street (2014)/' did not exist on check 1 of 5. Checking again in 15 seconds...
2020-05-20 00:17:15,517 -     INFO -      PLEX [140704391613216]: File '/mnt/unionfs/movies/22 Jump Street (2014)/' did not exist on check 2 of 5. Checking again in 15 seconds...
2020-05-20 00:17:30,529 -     INFO -      PLEX [140704391613216]: File '/mnt/unionfs/movies/22 Jump Street (2014)/' did not exist on check 3 of 5. Checking again in 15 seconds...
2020-05-20 00:17:45,544 -  WARNING -      PLEX [140704391613216]: File '/mnt/unionfs/movies/22 Jump Street (2014)/' reached the penultimate file check. Changing scan path to '/mnt/unionfs/movies/22 Jump Street (2014)'. Final check commences in 15 seconds...
2020-05-20 00:18:00,559 -  WARNING -      PLEX [140704391613216]: File '/mnt/unionfs/movies/22 Jump Street (2014)' exhausted all available checks. Aborting scan request.
2020-05-20 00:18:00,564 -     INFO -      PLEX [140704391613216]: Removed '/mnt/unionfs/movies/22 Jump Street (2014)/' from Plex Autoscan database.
It seems to be the same error as @coltonomore was having. Wondering if anyone has any advice on how to get running? I've started from scratch with the config from the zip file. Confirmed that the file is present.

Would very much appreciate a pair of more seasoned eyes.

Thank you!
 

timetrex

Elite
Staff
Oct 22, 2018
219
56
Plex autoscan is checking for the file but it hasn't finished uploading. In the config it is set for 5 tries. I have amended my config to 15 tries as I do upload 4k content as well, with file sizes on average 50-60gb. It gives it time to download, upload and for Plex autoscan to pick up on it.

If you change the config in the appdata folder to perhaps 10. I suspect that will work better for you.
 

stammbraeu

Experienced+
Staff
Donor
Mar 21, 2018
112
42
but shouldnt that be covered by unionfs?
You download the file to eg. /mnt/downloads/...

There it gets picked up by sonarr/radarr and moved to /mnt/unionfs/
where it will be sent to /mnt/move/... which is unified to /mnt/unionfs/

by being picked up by sonarr/radarr you trigger the plex autoscan which is able to see it in /mnt/unionfs/... (its actually on /mnt/move/... but that folder is merged to /mnt/unionfs/)

Then when the upload is complete the file gets moved to /mnt/tcrypt (in my case for encrypted blitz)

As this folder is also unified to /mnt/unionfs/ it should not be possible for autoscan not to see the file in /mnt/unionfs/...

---------------------

In the webhook settings:
do you have "on grab" enabled - because thats the only case when the file is actually not there


all the best
Stammbraeu
 
  • Like
Reactions: 1 user

timetrex

Elite
Staff
Oct 22, 2018
219
56
It's completely possible, if the file hasn't completed downloading or is repairing , extracting etc , Plex autoscan may have already checked 5 times for the file.

If your downloading multiple files , repairing and extracting then it's likely Plex autoscan will miss scanning the file as it won't have been uploaded to /mnt/unionfs
 

stammbraeu

Experienced+
Staff
Donor
Mar 21, 2018
112
42
i dont get it

when you use the webhook and set it to:
on import
on upgrade
on rename

based on my understanding this webhook is triggered when the file gets imported/upgraded/renamed by sonarr/radarr
which in turn means that it is placed in the folder where you want it to end up e.g. /mnt/unionfs/movies/...

therefore the file is already extracted/repaired/... - its in its final destination so i dont see how this should happen

and what do you mean by uploading to /mnt/unionfs/ ?

/mnt/unionfs/ is the merger of multiple folders:
/mnt/move/
/mnt/gcrypt/
/mnt/gdrive/
/mnt/tdrive/
/mnt/tcrypt/
depending on your setup


dont get me wrong - im far from being the expert but i cant see how this case should happen - the only way i could imagine is that the move (on your NVME/SSD/HD) from the download folder to the unionfs folder (still on your disk) takes very long which shouldnt be the case
 

GrahamC7388

Noobz
Oct 13, 2019
2
0
Thank you for the replies and the assistance!

Some other details that may be relevant, I have a hetzner box with a 2nd drive, and have pgblitz encrypted set up. The processing location for me is /mnt/vol2/ with items being processed on the secondary drive. I've set the secondary drive in PG Processing disk settings, and everything is working fine for uploads to TDrive, the only trouble seems to be with plex_autoscan.

Wondering if I might need to update one of the path settings in config.json.j2 to reflect the processing location? I'm just not sure which one...

The strange part is that if I use the plexautoscan website to test, and attempt to manually scan a folder that does exist at /mnt/unionfs/movies/nameofmovie, it gives the same error message 'file does not exist'

The config.json.j2 file is unmodified from the one included in the zip file at the top of the thread, save for the file check delay setting I changed just recently, which unfortunately lead to the same results.

Also, I have sonarr and radarr set to on download, upgrade and rename.

I appreciate any suggestions :)
 

loa92

Active
Donor
Aug 31, 2018
31
6
I'm running into the same problem as @GrahamC7388

Everything installs fine, and I can even reach plexautoscan from the web to force a manual scan, but no matter what I get the same "did not exist on check xx of xx".

I know the file exists, and is sitting in mnt/unionfs/movies/(name of movie)

I'll play around with it more later, but yeah, same issue.

Thank you for the replies and the assistance!

Some other details that may be relevant, I have a hetzner box with a 2nd drive, and have pgblitz encrypted set up. The processing location for me is /mnt/vol2/ with items being processed on the secondary drive. I've set the secondary drive in PG Processing disk settings, and everything is working fine for uploads to TDrive, the only trouble seems to be with plex_autoscan.

Wondering if I might need to update one of the path settings in config.json.j2 to reflect the processing location? I'm just not sure which one...

The strange part is that if I use the plexautoscan website to test, and attempt to manually scan a folder that does exist at /mnt/unionfs/movies/nameofmovie, it gives the same error message 'file does not exist'

The config.json.j2 file is unmodified from the one included in the zip file at the top of the thread, save for the file check delay setting I changed just recently, which unfortunately lead to the same results.

Also, I have sonarr and radarr set to on download, upgrade and rename.

I appreciate any suggestions :)
 

timetrex

Elite
Staff
Oct 22, 2018
219
56
It is being included, there is also a fork which includes jellyfin/emby
 
  • Like
Reactions: 1 user

rcarteraz

Veteran
Donor
Nov 14, 2018
164
42
It is being included, there is also a fork which includes jellyfin/emby
Awesome because for the life of me I cannot get it to work. I followed all of the directions and it was able to deploy and then it was giving me errors. I follow the process to change the token manually as mentioned above and after that the docker won't even deploy.
 
  • Like
Reactions: 1 user

Recommend NewsGroups

      Up To a 58% Discount!

Trending