Describe the bug
Upgraded to Sonarr v4 (beta) (exact current build: 4.0.0.200) and started getting error 405/415 when post processing files
Technical Specs
Ubuntu 22.04
Python 3.11
NZBget
Sonarr
Expected behavior
Expected behavior is that Sonarr successfully detects the incoming file that was successfully downloaded and moved to the correct destination folder.
Log
2022-11-29 16:42:17 POSTPROCESS::NZBDRONE: SUCCESS: The download succeeded, sending a post-process request
2022-11-29 16:39:20 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED
2022-11-29 16:39:20 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED", "downloadClientId": "xxx", "importMode": "Move"}
2022-11-29 16:39:20 ERROR ::NZBDRONE: Server returned status 405
To get it to work I first changed core/auto_process/tv.py to sonarr api calls to include v3:
after that change the error output was 415:
2022-11-29 16:43:35 POSTPROCESS::NZBDRONE: SUCCESS: The download succeeded, sending a post-process request
2022-11-29 16:43:35 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED
2022-11-29 16:43:35 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/v3/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED", "downloadClientId": "xxx", "importMode": "Move"}
2022-11-29 16:43:36 ERROR ::NZBDRONE: Server returned status 415
one more edit to add application/json to headers and it works::
2022-11-29 16:47:52 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED
2022-11-29 16:47:52 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/v3/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED/REMOVED", "downloadClientId": "xxx", "importMode": "Move"}
2022-11-29 16:47:52 DEBUG ::NZBDRONE: Scan started with id: 6211618
2022-11-29 16:48:12 DEBUG ::NZBDRONE: The Scan command return status: completed
2022-11-29 16:48:12 DEBUG ::NZBDRONE: The directory /opt/nzbget/unsorted/REMOVED has been removed. Renaming was successful.
2022-11-29 16:48:12 INFO ::MAIN: The /opt/nzbget/scripts/nzbToMedia/nzbToNzbDrone.py script completed successfully.
Looks like the API has had some changes, similar to radarr v4 (https://github.com/clinton-hall/nzbToMedia/issues/1862).
Not sure if the edits break compatibility with sonarr v3 or not as I didn't test edits with v3. (or if there is better way to fix post processing)
FYI, this change was added in d0b555c251dd1a33bec7c3a16ef523cea6b32460. Just waiting for that to get merged into the master branch (currently it's only in the Sonar-apiv3 branch.
Describe the bug Upgraded to Sonarr v4 (beta) (exact current build: 4.0.0.200) and started getting error 405/415 when post processing files
Technical Specs
Expected behavior Expected behavior is that Sonarr successfully detects the incoming file that was successfully downloaded and moved to the correct destination folder.
Log 2022-11-29 16:42:17 POSTPROCESS::NZBDRONE: SUCCESS: The download succeeded, sending a post-process request 2022-11-29 16:39:20 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED 2022-11-29 16:39:20 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED", "downloadClientId": "xxx", "importMode": "Move"} 2022-11-29 16:39:20 ERROR ::NZBDRONE: Server returned status 405
To get it to work I first changed core/auto_process/tv.py to sonarr api calls to include v3:
after that change the error output was 415: 2022-11-29 16:43:35 POSTPROCESS::NZBDRONE: SUCCESS: The download succeeded, sending a post-process request 2022-11-29 16:43:35 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED 2022-11-29 16:43:35 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/v3/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED", "downloadClientId": "xxx", "importMode": "Move"} 2022-11-29 16:43:36 ERROR ::NZBDRONE: Server returned status 415
one more edit to add application/json to headers and it works::
2022-11-29 16:47:52 DEBUG ::NZBDRONE: path: /opt/nzbget/unsorted/REMOVED 2022-11-29 16:47:52 DEBUG ::NZBDRONE: Opening URL: http://localhost:8082/api/v3/command with data: {"name": "DownloadedEpisodesScan", "path": "/opt/nzbget/unsorted/REMOVED/REMOVED", "downloadClientId": "xxx", "importMode": "Move"} 2022-11-29 16:47:52 DEBUG ::NZBDRONE: Scan started with id: 6211618 2022-11-29 16:48:12 DEBUG ::NZBDRONE: The Scan command return status: completed 2022-11-29 16:48:12 DEBUG ::NZBDRONE: The directory /opt/nzbget/unsorted/REMOVED has been removed. Renaming was successful. 2022-11-29 16:48:12 INFO ::MAIN: The /opt/nzbget/scripts/nzbToMedia/nzbToNzbDrone.py script completed successfully.
Looks like the API has had some changes, similar to radarr v4 (https://github.com/clinton-hall/nzbToMedia/issues/1862). Not sure if the edits break compatibility with sonarr v3 or not as I didn't test edits with v3. (or if there is better way to fix post processing)