Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Append method with AddTop issue #810

Open
Sonic3R opened this issue Mar 29, 2022 · 0 comments
Open

Append method with AddTop issue #810

Sonic3R opened this issue Mar 29, 2022 · 0 comments

Comments

@Sonic3R
Copy link

Sonic3R commented Mar 29, 2022

I use C# code to upload nzb to nzbget

using (var client = new WebClient())
{
	client.BaseAddress = "url-with-user-and-password/jsonrpc";

	var nzbName = Path.GetFileName(nzb);
	nzbName = nzbName.Split('{')[0].TrimEnd('-');

	var nzbContentBytes = File.ReadAllBytes(nzb);
	var nzbContent = Convert.ToBase64String(nzbContentBytes);

        // it will be: 
        // {"method":"append","params":["My.nzb","CONTENT OF nzbContent here","",0,False,True,"",0,"'SCORE'",[('*unpack:', 'yes')]]}
	var formattedUploadCmd = uploadCmd.Replace("%NZB_NAME%", nzbName).Replace("%NZB_CONTENT%", nzbContent);

	var response = client.UploadStringTaskAsync(url, "POST", formattedUploadCmd).ConfigureAwait(true).GetAwaiter().GetResult();
}

the error I got is:

{
"version" : "1.1",
"error" : {
"name" : "JSONRPCError",
"code" : 2,
"message" : "Invalid parameter (AddTop)"
}

I tried to add quotes to True/False params, to integer numbers but I got same error

Don't know where is my mistake

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant