Skip to content
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

Open
Leyous opened this issue Feb 5, 2024 · 23 comments
Assignees
Labels
bug Something isn't working

Comments

@Leyous
Copy link

Leyous commented Feb 5, 2024

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 :(

@Leyous Leyous added the bug Something isn't working label Feb 5, 2024
@lennon1997
Copy link

This is what I have working right now but it's definitely flawed lol.

Add-Type -AssemblyName System.Web

$plex_url = "http://yourplexip:32400/"
$token = "YourPlexTokenHere"
$zurg_mount = "YourZurgMountLetterHere:"

$section_ids = (Invoke-WebRequest -Uri "$plex_url/library/sections" -Headers @{"X-Plex-Token" = $token} -Method Get).Content |
Select-Xml -XPath "//Directory/@key" |
ForEach-Object { $_.Node.Value }

$inputString = $args

$matches = [regex]::Matches($inputString, '(\w+)/([^/]+)')
$sortedMatches = $matches | Sort-Object { if ($_ -match 'movies|shows') { 1 } else { 2 } }

foreach ($match in $sortedMatches) {
$type = $match.Groups[1].Value
$path = $match.Groups[2].Value

if ($type -eq 'zurg' -or $type -eq '__all__') {
    continue
}

$path = $path -replace '__all__', ''

Write-Host "Type: $type, Path: $path"

$modified_arg = Join-Path -Path $zurg_mount -ChildPath "$type/$path"
$encoded_arg = [System.Web.HttpUtility]::UrlEncode($modified_arg)

if ([string]::IsNullOrEmpty($encoded_arg)) {
    Write-Host "Error: Encoded argument is empty. Check the input or encoding process."
    continue
}

foreach ($section_id in $section_ids) {
    $final_url = "${plex_url}/library/sections/${section_id}/refresh?path=${encoded_arg}&X-Plex-Token=${token}"
	# Remove the last '+' character from the path
	$final_url = $final_url -replace '\+(?=[^+]*$)'

    Write-Host "Section ID: $section_id"
    Write-Host "Final URL: $final_url"

    Invoke-WebRequest -Uri $final_url -Method Get
}
}

Write-Host "All updated sections refreshed"

@yowmamasita
Copy link
Contributor

This is fixed on the next release.

@yowmamasita
Copy link
Contributor

@Leyous
Copy link
Author

Leyous commented Feb 7, 2024

https://github.com/debridmediamanager/zurg-testing/releases/tag/v0.9.3-hotfix.9

I installed this version but the problem's still there.

An Example:
"Detected update on: movies/H.Pott.and.the.Sorc.St.2001.4K.HDR.2160p.BDRip"

But the complete folder name is "H.Pott.and.the.Sorc.St.2001.4K.HDR.2160p.BDRip Ita Eng x265"

@yowmamasita
Copy link
Contributor

@Leyous
image

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

@Leyous
Copy link
Author

Leyous commented Feb 7, 2024

@Leyous image

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'

@ErgoProxyKilla
Copy link

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.

Something like this?
image

@Leyous image

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

@xkenx1995
Copy link

xkenx1995 commented Feb 8, 2024

@Leyous image
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'

try this

# Plex server details
$plexUrl = "http://plexip:32400"
$plexToken = "plextoken"

# Function to URL encode a string
function UrlEncode($value) {
    [System.Web.HttpUtility]::UrlEncode($value)
}

# Function to trigger library update for a specific folder
function UpdateFolder($folder) {
    $encodedPath = UrlEncode($folder.FullName)
    $refreshUrl = "$plexUrl/library/sections/all/refresh?path=$encodedPath&checkFiles=1"

    $headers = @{
        "X-Plex-Token" = $plexToken
    }

    try {
        # Trigger the library update for the specific folder
        Invoke-RestMethod -Uri $refreshUrl -Method Get -Headers $headers -ErrorAction Stop
        Write-Host "Partial refresh request successful for: $($folder.FullName)"
    } catch {
        Write-Host "Error refreshing: $($folder.FullName)"
        Write-Host "Error details: $_"
    }
}

# Function to trigger library updates for all folders modified within the last 5 minutes
function UpdateFoldersWithinLast5Minutes($directories) {
    $startTime = (Get-Date).AddMinutes(-5)

    foreach ($directory in $directories) {
        $folders = Get-ChildItem -Path $directory -Directory | Where-Object { $_.LastWriteTime -gt $startTime }

        if ($folders.Count -gt 0) {
            Write-Host "Folders found in $directory modified within the last 5 minutes:"
            
            # Introduce a 10-second delay before triggering the library update for each folder
            Start-Sleep -Seconds 10

            foreach ($folder in $folders) {
                UpdateFolder $folder
            }
        } else {
            Write-Host "No folders found in $directory modified within the last 5 minutes."
        }
    }
}

# Example usage - update folders modified within the last 5 minutes
$directoriesToUpdate = @("Z:\Movies", "Z:\Anime", "Z:\Shows")
UpdateFoldersWithinLast5Minutes $directoriesToUpdate

Write-Host "All updated sections partially refreshed."

just replace plexip with your plex server ip and add your plex token

@ajitid
Copy link

ajitid commented Feb 10, 2024

@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.
I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

@ErgoProxyKilla
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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.

@ajitid
Copy link

ajitid commented Feb 12, 2024

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 on_library_update: '& poetry run python trigger_scan.py --%'. (You can read about it here.) Everything works well for me now!

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 $args (equivalent to $@) or not:

2024-02-12T00:30:37.189+0530    ERROR   manager Failed to execute hook on_library_update: error executing script: exit status 1; stderr: 1080p\ : The term '1080p\' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:100
+ ... ws/Brooklyn\ Nine-Nine\ (2013)\ Season\ 1-8\ S01-S08\ (1080p\ BluRay\ ...
+                                                            ~~~~~~
    + CategoryInfo          : ObjectNotFound: (1080p\:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

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:

Built At: 2024-02-07T13:06:42
Commit: c3ce271fdfbfa1bb45710867cc4a4c927e1654b2
Version: v0.9.3-hotfix.9

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:

Death Note - S01 - ENG UNCUT 1080p WEB H.264 -NanDesuKa (FUNi)

It gives me:

stderr: FUNi : The term 'FUNi' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:127
+ ... \ -\ S01\ -\ ENG\ UNCUT\ 1080p\ WEB\ H.264\ -NanDesuKa\ (FUNi) shows/ ...
+                                                              ~~~~
    + CategoryInfo          : ObjectNotFound: (FUNi:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@ErgoProxyKilla
Copy link

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 on_library_update: '& poetry run python trigger_scan.py --%'. (You can read about it here.) Everything works well for me now!

For the aforementioned powershell script by @/xkenx1995 however, you can follow this reddit post.

Previous comment

Thanks! I decided to setup Python and use your script and it's working. PowerShell was being too much of a headache.

@ajitid
Copy link

ajitid commented Feb 14, 2024

Kinda surprised you say that! There's stuff required to make it work, like 1. adding --rc flag to your rclone mount zurg: ... command, 2. if you're on Windows and using nssm to run rclone then reducing privilege of the service to run as local user. And I didn't mention these things in the GitHub Gist.

If it properly works you all the time, then great!

@yowmamasita
Copy link
Contributor

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

@ajitid
Copy link

ajitid commented Feb 15, 2024

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 on_library_update when a content is added, and I can pass on those paths to Plex for update, but I don't get a path on a removal of a content. I'd prefer if that gets fixed.

(Edited my comment and now it'll make more sense when read)

@yowmamasita
Copy link
Contributor

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.

@ajitid
Copy link

ajitid commented Feb 15, 2024

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.

@ErgoProxyKilla
Copy link

Kinda surprised you say that! There's stuff required to make it work, like 1. adding --rc flag to your rclone mount zurg: ... command, 2. if you're on Windows and using nssm to run rclone then reducing privilege of the service to run as local user. And I didn't mention these things in the GitHub Gist.

If it properly works you all the time, then great!

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.

@digitalbarrito
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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.

@ErgoProxyKilla
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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:
on_library_update: '& python .\trigger_scan.py --%'

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 window.localStorage.getItem("myPlexAccessToken") and press Enter. That will give you the token for your current logged in session. As long as plex doesn't give you a prompt to log in again on the PC hosting the server, the token should remain the same.

@digitalbarrito
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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: on_library_update: '& python .\trigger_scan.py --%'

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 window.localStorage.getItem("myPlexAccessToken") and press Enter. That will give you the token for your current logged in session. As long as plex doesn't give you a prompt to log in again on the PC hosting the server, the token should remain the same.

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

Transcript started, output file is M:\zurg\logs\plex_update.log
Normal method
PS>TerminatingError(Invoke-WebRequest): "Object reference not set to an instance of an object."
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

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.

@ErgoProxyKilla
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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: on_library_update: '& python .\trigger_scan.py --%'
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 window.localStorage.getItem("myPlexAccessToken") and press Enter. That will give you the token for your current logged in session. As long as plex doesn't give you a prompt to log in again on the PC hosting the server, the token should remain the same.

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

Transcript started, output file is M:\zurg\logs\plex_update.log
Normal method
PS>TerminatingError(Invoke-WebRequest): "Object reference not set to an instance of an object."
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

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.

pip install plexapi

@digitalbarrito
Copy link

@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. I have created the script and have used it for a day. It seems to work pretty well for me. Here it is.

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: on_library_update: '& python .\trigger_scan.py --%'
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 window.localStorage.getItem("myPlexAccessToken") and press Enter. That will give you the token for your current logged in session. As long as plex doesn't give you a prompt to log in again on the PC hosting the server, the token should remain the same.

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

Transcript started, output file is M:\zurg\logs\plex_update.log
Normal method
PS>TerminatingError(Invoke-WebRequest): "Object reference not set to an instance of an object."
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Invoke-WebRequest : Object reference not set to an instance of an object.
At M:\zurg\plex_update.ps1:25 char:21
+ ... tion_ids = (Invoke-WebRequest -Uri "$plexUrl/library/sections" -Heade ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

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.

pip install plexapi

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants