New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: The script plex_update.ps1 truncates paths when there's a space in a movie folder title, so the refresh fails #72
Comments
This is what I have working right now but it's definitely flawed lol.
|
This is fixed on the next release. |
I installed this version but the problem's still there. An Example: But the complete folder name is "H.Pott.and.the.Sorc.St.2001.4K.HDR.2160p.BDRip Ita Eng x265" |
This is the code that processes all paths coming from the torrent manager and pushes it to the script hook Since I don't have a Windows machine, can you try what sort of argument escaping/encoding I should be doing in order for your script to parse it properly |
Sorry dude, I'm not a developer, I understand PowerShell a little. I think you can pass the string in single quotes for Powershell to parse it correctly, but I may not fully understand the problem :( Example: $PowershellString = 'H.Pott.and.the.Sorc.St.2001.4K.HDR.2160p.BDRip Ita Eng x265' |
I checked around and it seems that enclosing the whole filename between double quotes would resolve the issue on Windows. Otherwise, if using strings.ReplaceAll then the character ` can be used so that it's properly picked up for PowerShell.
|
try this
just replace plexip with your plex server ip and add your plex token |
@xkenx1995 I used the script you mentioned above but it too fails when a specific mix of a bracket and a space is involved. Can I rather suggest to use a python script that doesn't consider the args it receives, and instead itself figures out the the plex dirs to update? The benefit here would be that one could be able to run the script independently. |
Do you have an example where the script xkenx1995 provided didn't work? I would like to test both your script and him for different cases. |
Ignore everything I said previously — u/Nem3sis2k17 on reddit and me googling made me discover that I could have taken in incoming args from zurg as raw params. And thus for my script at least, all I had to do was to use For the aforementioned powershell script by @/xkenx1995 however, you can follow this reddit post. Previous comment@ErgoProxyKilla seems like that wasn't xkenx1995's script issue but of rather zurg's. I see this output when I try to use on_library_update for some media folders irrespective of whether I've used
Here's what I was trying to add: Brooklyn Nine-Nine (2013) Season 1-8 S01-S08 (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence) Notice that there's a bracket early at (2013) as well, but zurg fails to run on_library_update when it encounters second open parenthesis. I'm on zurg:
PS: I'm unable to understand why we have to escape spaces at all. We can put the whole path in single quotes, which is supported across all platforms. Or leverage shell escape feature of the programming language zurg uses. Another string I found where zurg has issues with brackets:
It gives me:
|
Thanks! I decided to setup Python and use your script and it's working. PowerShell was being too much of a headache. |
Kinda surprised you say that! There's stuff required to make it work, like 1. adding If it properly works you all the time, then great! |
I think the best way to fix this is to do the plex updates inside zurg itself to make it compatible for OSes I'll do this on the next release |
Well putting update logic inside zurg may not pan out. Zurg doesn't know about rclone right now, and that's a good thing. Honestly the only thing that's missing right now is when a content (TV show or a movie) is removed, zurg doesn't tell what exactly is removed. So I get some paths to work with in (Edited my comment and now it'll make more sense when read) |
Hmm true, it makes zurg coupled with a specific stack which is against its overall vision There's another broken thing which is properly encoding parens on paths. Idk how to do this properly because not having a windows machine, I cannot test how different the handling is on all OSes. I'm thinking of encoding the paths to base64 and relying on scripts to decode this and encode properly. |
(If I'm understanding the problem correctly) Why not send the whole string of the path inside single quotes? This will works across all platforms. Or use Quote fn from shellwords. I'm on Windows, and I know Go. Give me a piece of code with string paths that you want to check. I'll test them out and will let you know. |
Yeah, it wasn't working for me. I had added the --rc as well as the vfs commands (since I saw it on a different reddit thread). When following the reddit thread, I found an updated ps1 script from the same user as the first thread (which had fixed the spaces) that made it so it would update plex immediately and was testing it out. It was working but not consistently. I found it wasn't liking [ ] characters and it was back at not escaping spaces correctly. I kept trying for a couple of hours and gave up. I came back to this issue and saw your comment and decided to try it and it worked first try, even on the problem files for the previous script. |
How do I go about switching to this script instead? I'm having a bunch of headaches with the plex_update.ps1 I downloaded that script and changed the url and token, I assume I need to change the config.yml as well, but I'm not sure what I would change that too. Any help would be greatly appreciated. |
You would need to add the following to the config.yml: Make sure to comment out the command for the .ps1 script and also make sure you add --rc to the rclone mount command. With those changes, it worked for me. However, I would suggest you try again the .ps1 but with the changes from the following link: final_revision_of_the_plex_update_script_for_windows This made the .ps1 work for me on Windows. Please note that the plex token is temporary (as in, if you log into plex again on the same computer, the token changes). So you need to make sure you're using the latest one. When you login, open developer tools (F12) and go to console and put this in |
I'm using that latest version of the .ps1 already, I've tried updating my tokens and everything, any time I add anything via DMM or to my Plex Watchlist no update of the library takes place in Plex, I have to manually re-scan for it to actually pick up
and this is what I get in my log whenever I add anything. I'm really not sure what I'm doing wrong. I tried the above change for the python script as well, and that threw an error about plexapi and also didn't work. |
Yes, you need to install the plexapi library if you hadn't already since the script uses it.
|
Thank you so much! This got the python script working, I added a movie to my watch list and without touching anything it actually refreshed my library and picked up the movie! |
Expected Behavior
A folder with spaces in the name should be correctly addressed
Actual Behavior
When in movies directory is created a new folder (for a new movie file) that has spaces in his name, the path is truncated
Detailed Steps
Add whatever movie that creates a folder with spaces in name. Used DebridMediaManager.
Operating System
What OS are you running? Windows 10, not using WSL
If on Windows, are you using Windows Subsystem for Linux (WSL)? No
Environment Setup
Binary:
Built At: 2024-01-18T20:55:36
Commit: 6a15f233af5665658cc0540d5486a93ffd73d221
Version: v0.9.3
I'm using the Powershell script to refresh the plex media library.
Logs
Not working the upload page :(
The text was updated successfully, but these errors were encountered: