Page 1 of 1
API call to update rss filter
Posted: July 15th, 2011, 5:38 am
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§ion=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§ion=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
Re: API call to update rss filter
Posted: July 15th, 2011, 5:58 am
by shypike
Make sure you do proper URL quoting (like %20 for space and %2C for comma)
Re: API call to update rss filter
Posted: July 15th, 2011, 6:09 am
by mrboring
Hi shypike
I tried:
Code: Select all
http://localhost:8085/sabnzbd/api?apikey=<key>&mode=set_config§ion=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
Re: API call to update rss filter
Posted: July 15th, 2011, 8:04 am
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§ion=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.
Re: API call to update rss filter
Posted: July 15th, 2011, 8:23 am
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
Re: API call to update rss filter
Posted: July 15th, 2011, 8:33 am
by shypike
category, PP, script, type, regex, priority
Where type = A(ccept) R(eject) C(ategory-required) M(ust-contain)
Re: API call to update rss filter
Posted: July 15th, 2011, 8:40 am
by mrboring
Hi shypike
Thanks for the info.
Alan