API call to update rss filter

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
mrboring
Newbie
Newbie
Posts: 4
Joined: July 15th, 2011, 5:20 am

API call to update rss filter

Post by mrboring »

Hi All

I'm trying to use the API to update an rss filter. Unfortunately I'm not having much success.

Using:

Code: Select all

http://localhost:8085/sabnzbd/api?mode=get_config&section=rss&apikey=<key>
I get a bunch of json. Some of which looks like:

Code: Select all

'filter1': ['tv', '', 'None', 'A', '<filter>', 'None']
I'm trying to replace <filter> with an amended one. However, I get unpredictable results. Here's the call I'm using:

Code: Select all

http://localhost:8085/sabnzbd/api?apikey=<key>&mode=set_config&section=rss&keyword=NewFeed&filter1=tv,,None,A,<new filter>,None
I should mention that I'm new to the API and json.

I would be grateful for an example of how to update an rss filter via the API.

Thanks in advance.

Alan
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API call to update rss filter

Post by shypike »

Make sure you do proper URL quoting (like %20 for space and %2C for comma)
mrboring
Newbie
Newbie
Posts: 4
Joined: July 15th, 2011, 5:20 am

Re: API call to update rss filter

Post by mrboring »

Hi shypike

I tried:

Code: Select all

http://localhost:8085/sabnzbd/api?apikey=<key>&mode=set_config&section=rss&keyword=NewFeed&filter0=tv%2C%2CNone%2CA%2Ctest%2CNone
But it still did not change the filter.

I get the following returned to the browser:

Code: Select all

{'rss': [{'pp': '', 'enable': 0, 'name': 'NewFeed', 'script': '', 'uri': '', 'cat': '', 'priority': -100, 'filter0': ['tv', 'None', 'A', 'test', 'None', '']}]}
I might be wrong, but this looks like it worked. But when I look in Sabnzbd+ > Config > RSS > NewFeed the original filter is there. This confuses me.

Alan
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API call to update rss filter

Post by shypike »

It looks like leading empty parameters aren't accepted.
I think this one will work:

Code: Select all

http://localhost:8085/sabnzbd/api?mode=set_config&section=rss&keyword=aaa&filter0=Default%2CDefault%2CDefault%2CA%2Ctest
BTW: you'll need to refresh the page before the filters will be updated in the UI.
They will be immediately updated internally.
mrboring
Newbie
Newbie
Posts: 4
Joined: July 15th, 2011, 5:20 am

Re: API call to update rss filter

Post by mrboring »

Hi shypike

That worked! Thanks.

Just in case I need to change something other than the filter, would you know what the order of parameters is?

Thanks again.

Alan
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: API call to update rss filter

Post by shypike »

category, PP, script, type, regex, priority
Where type = A(ccept) R(eject) C(ategory-required) M(ust-contain)
mrboring
Newbie
Newbie
Posts: 4
Joined: July 15th, 2011, 5:20 am

Re: API call to update rss filter

Post by mrboring »

Hi shypike

Thanks for the info.

Alan
Post Reply