Sabnzbd script to trigger NzbDrone series refresh

My OS platform is WinVista32 and my storage is on a NAS. Sab handles all nzb sorting and renaming, I have no need for periodic checks in the Drone Factory Folder.

I followed the instructions in the wiki https://github.com/NzbDrone/NzbDrone/wiki/Disable-Drone-Factory-Folder-Scanning

Wanting to run the cURL script from CLI I installed cURL from http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000%2FXP

I took the cURL script from the wiki and replaced the command with refreshseries from https://github.com/NzbDrone/NzbDrone/wiki/Command#refreshseries
curl http://localhost:8989/api/command -X POST -d '{"name": "refreshseries"}' --header "X-Api-Key:YOUR_API_KEY_GOES_HERE"

But I get this output:

{ "message": "Unterminated string. Expected delimiter: '. Path '', line 1, position 7.", "description": "Newtonsoft.Json.JsonReaderException: Unterminated string. Expected delimiter: '. Path '', line 1, position 7.\\r\ at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)\\r\ at Newtonsoft.Json.JsonTextReader.ParseString(Char quote)\\r\ at Newtonsoft.Json.JsonTextReader.ParseValue()\\r\ at Newtonsoft.Json.JsonTextReader.ReadInternal()\\r\ at Newtonsoft.Json.JsonTextReader.Read()\\r\ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)\\r\ at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\\r\ at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\\r\ at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)\\r\ at NzbDrone.Api.Extensions.ReqResExtensions.FromJson(Stream body, Type type) in m:\\\\buildAgent2\\\\work\\\\328d72309b633a8\\\\src\\\zbDrone.Api\\\\Extensions\\\\ReqResExtensions.cs:line 31\\r\ at NzbDrone.Api.Extensions.ReqResExtensions.FromJson[T](Stream body, Type type) in m:\\\\buildAgent2\\\\work\\\\328d72309b633a8\\\\src\\\zbDrone.Api\\\\Extensions\\\\ReqResExtensions.cs:line 24\\r\ at NzbDrone.Api.Extensions.ReqResExtensions.FromJson[T](Stream body) in m:\\\\buildAgent2\\\\work\\\\328d72309b633a8\\\\src\\\zbDrone.Api\\\\Extensions\\\\ReqResExtensions.cs:line 19\\r\ at NzbDrone.Api.REST.RestModule1.ReadResourceFromRequest() in m:\\buildAgent2\\work\\328d72309b633a8\\src\\zbDrone.Api\\REST\\RestModule.cs:line 188\r
at NzbDrone.Api.REST.RestModule1.<set_CreateResource>b__f(Object options) in m:\\\\buildAgent2\\\\work\\\\328d72309b633a8\\\\src\\\zbDrone.Api\\\\REST\\\\RestModule.cs:line 155\\r\ at CallSite.Target(Closure , CallSite , Func2 , Object )\r
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)"
}`

Any idea of what is going wrong here?

First off, you don’t want to use refreshseries on a regular basis, especially on your entire library, as it fetches the series/episode data for every series in your library as well as scanning the disk. This puts a lot of load on a free service and could result in our apikey getting banned or blocked.

I don’t see anything wrong with the curl command, based on the error it’s expecting a single quote ’ after the name key, have the quotes been altered? Its possible curl on Windows uses different syntax, you could use the power she’ll snippet though.

Ok, I’ll install Power Shell and give it a try.

What command could I use to rescan the disk for new episodes? Besides refreshseries all other commands require a series/episode ID.

Just updated RescanSeries to work without a series ID (it will rescan all if absent), its in develop (currently building), 2.0.0.1322 or higher will be the one to grab.

Thanks!

just transpose the ’ and the " for windows; that is:
curl http://localhost:8989/api/command -X POST -d “{‘name’:‘refreshseries’}” --header “X-Api-Key:YOUR_API_KEY_GOES_HERE”

I also deleted the space after ‘:’ but I doubt that matters.