Unable to trigger a library refresh via Terminal

Server Version#: 1.42.2.10156
Player Version#: NA
Logs:

Request: [127.0.0.1:52131 (Loopback)] PUT /library/sections/11/refresh (20 live) #58e Signed-in Token (REDACTED)

Completed: [127.0.0.1:52131] 404 PUT /library/sections/11/refresh (20 live) #58e 1ms 288 bytes (pipelined: 1)

I run a Terminal script at set intervals to bring videos into a specific library. Once done, I want to trigger a scan so Plex can see the changes. The videos are stored on my NAS while the Plex Media Server software runs on a separate Mac Mini. As such, it can’t auto-detect a filesystem change.

I’m trying to run the command: "curl -X PUT ā€˜http://192.168.50.4:32400/library/sections/11/refresh?X-Plex-Token={myToken}’ "

I’ve validated my token works (if I put the URL in Safari the scan does trigger) but when I try this via Terminal, I get a Not Found return.

<html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>

I’m not sure how I can script this to tell Plex new files are present so it can scan & display them for me to watch. Any help on this would be greatly appreciated. Thank you!

Don’t use PUT, use GET.

2 Likes

Thank you!!! So glad it was something stupid-simple that fixed it.

Any chance you can give me a tip on emptying trash? This used to work but the following code results in a ā€œno such file or directoryā€ error.

"curl -X GET 'http://192.168.50.4:32400/library/sections/11/emptyTrash?X-Plex-Token={my Token}'"

zsh: no such file or directory:

Think you need to use PUT for that endpoint :slight_smile: See this for details …

… which also shows you a trick on how to use the debugger to figure out what the endpoint uses.

1 Like

NICE!! I’ll get to work on that. Thank you again!

1 Like