Sonarr version (exact version): 2.0.0.5344
Mono version (if Sonarr is not running on Windows):
OS: Windows 7
Debug logs:
20-8-22 00:04:59.7|Trace|Http|Req: 529 [POST] /api/command?apikey=(removed)
20-8-22 00:04:59.7|Trace|Http|Res: 529 [POST] /api/command?apikey=(removed) 303.SeeOther (0 ms)
20-8-22 00:04:59.7|Debug|Api|[POST] /api/command?apikey=(removed) 303.SeeOther (0 ms)
20-8-22 00:04:59.7|Trace|Http|Req: 530 [GET] /api/command?apikey=(removed)
20-8-22 00:04:59.7|Trace|CommandQueueManager|Getting started commands
20-8-22 00:04:59.7|Trace|Http|Res: 530 [GET] /api/command?apikey=(removed) 200.OK (15 ms)
20-8-22 00:04:59.7|Debug|Api|[GET] /api/command?apikey=(removed) 200.OK (15 ms)
Description of issue:
Hi,
I’m hoping someone can help me with an issue I’m having. I have a post-processing script that NZBGet runs when it finishes downloading a TV show. It does a variety of things, including cleaning up unwanted files, calling Handbrake to re-encode the show, and finally, it’s SUPPOSED to call Sonarr’s API to have Sonarr import the show (which then causes Sonarr to update Plex). For months (if not years), this was working absolutely beautifully, but for some reason it no longer works. The script itself works fine - it does the cleanup and re-encoding, and does attempt a call to Sonarr’s API. The problem is that the API isn’t doing anything. It’s supposed to add the episode to Sonarr’s database as well as move the file to the configured folder. It seems to be giving me a 303 See Other error.
The relevant section of the script is:
$url = $SonarrURL + “:” + $SonarrPort + “sonarr/api/command”
$json = @{“name”=“DownloadedEpisodesScan”;“path”="$FinalJobFullPath"} | ConvertTo-Json
Write-Host “Publishing update to: [$url]”
Write-Host $json
Invoke-RestMethod -Uri $url -Method Post -Body $json -Headers @{“X-Api-Key”="$SonarrAPIKey"}
When all that is put together, the URL is “http://media_server:8989/sonarr/api/command”. I have also tried it with just “http://media_server:8989/api/command” - it’s this second one that has been in place and working for many months.
The JSON it creates is something like:
{
“name”: “DownloadedEpisodesScan”,
“path”: “C:\ProgramData\NZBGet\complete\Thundercats.S01E02.The.Unholy.Alliance.DVDRip.XviD-DIMENSION”
}
No matter what I do, I cannot get it to understand that there’s a finished file sitting there for it to process. I have not changed the script in months, aside from today when I was trying to debug this issue. I haven’t changed the system in months. Sonarr said it was last updated March 13, which was the most recent version. I did try re-installing Sonarr overtop of the current install, and then having it do an update. That didn’t seem to help. I have rebooted the system twice, as well as just restarting Sonarr separately. Nothing I’ve done has helped.
Does anyone have any ideas?
Thanks.