[Feature Request] Scripting support in RSS Feeds

Discuss newly added features or request new features.
get39678
Posts: 222
Joined: 09 Jun 2014, 10:49

[Feature Request] Scripting support in RSS Feeds

Post by get39678 » 15 Jun 2015, 15:42

I would like to manipulate the elements of each RSS entry before nzbget processes the Filter rule for the item.

I could then do some complex manipulation of the Name, Category and more fields (whatever is in the RSS <item></item>) and assign to a Custom1, Customer2, Custom3 element within the same node.

Code: Select all

<newznab:attr name="custom1" value="rss-script-function1(rssitem)" />
<newznab:attr name="custom2" value="rss-script-function2(rssitem)" />
<newznab:attr name="custom3" value="rss-script-function3(rssitem)" />
rssitem='<item><title><link><description><others></item>'
I can then refer to the Custom1 parameter in the RSS filter accept and reject rules?

I have tried a scan script but that is too late it is already in the queue and past the RSS filter accept and reject rules.

I do not want to replicate what is already written in the RSS filter options in my script.

Thanks

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 15 Jun 2015, 17:59

What comes to mind: after the rss feed is read from server and before it is processed the feed content will be saved to a temporary xml-file and a new script (new option "FeedScript") will be called. The script receives the path to the feed file as parameter. NZBGet waits until the script terminates and then reads the xml-file and processes it.

The script should modify the xml-file. Is it easy enough?

get39678
Posts: 222
Joined: 09 Jun 2014, 10:49

Re: [Feature Request] Scripting support in RSS Feeds

Post by get39678 » 16 Jun 2015, 15:48

hugbug wrote:What comes to mind: after the rss feed is read from server and before it is processed the feed content will be saved to a temporary xml-file and a new script (new option "FeedScript") will be called. The script becomes the path to the feed file as parameter. NZBGet waits until the script terminates and then reads the xml-file and processes it.

The script should modify the xml-file. Is it easy enough?
Yes that sounds perfect. This would be a great addition I hope it gets considered. I have no issues giving it a test and feeding back.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 21 Jun 2015, 19:26

I've created an issue on GitHub tracker to not forget this.

get39678
Posts: 222
Joined: 09 Jun 2014, 10:49

Re: [Feature Request] Scripting support in RSS Feeds

Post by get39678 » 22 Jun 2015, 16:10

hugbug wrote:I've created an issue on GitHub tracker to not forget this.
Great. Got my hopes up though seeing you were the last to post to the thread ;)

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 29 Jun 2015, 18:25

Implemented in branch 18-feed-script.
It'd be great if you could test it before it is merged into the main source code (develop).
See Build the latest development version for instructions.
Please provide feedback here or on GitHub issue tracker - Scripting support in RSS Feeds #18

get39678
Posts: 222
Joined: 09 Jun 2014, 10:49

Re: [Feature Request] Scripting support in RSS Feeds

Post by get39678 » 30 Jun 2015, 21:09

Only had chance to have a quick look so far and it seems great.
My only feedback at the moment is can it be made so a FEED script can also be a SCAN script?
When I define as a FEED script the script does not appear as a SCAN script and vice versa.

Do not know if this is branch specific but I do have an issue with the Rate Limiter always being set to 6KBs.
I shutdown nzbget and restart and it defaults to a limit of 6KBs regardless of what the settings are.

Thanks

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 30 Jun 2015, 21:18

get39678 wrote:can it be made so a FEED script can also be a SCAN script?
That should work. I'll take a look why it doesn't.
get39678 wrote:the Rate Limiter always being set to 6KBs.
Nothing was changed, not intentionally at least. Don't you have a scheduler task or may be another app sends commands to NZBGet?

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 30 Jun 2015, 21:30

hugbug wrote:
get39678 wrote:can it be made so a FEED script can also be a SCAN script?
That should work. I'll take a look why it doesn't.

Works for me:

Code: Select all

##############################################################################
### NZBGET SCAN/FEED SCRIPT                     ###

# Print hello message.

### NZBGET SCAN/FEED SCRIPT                     ###
##############################################################################

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Feature Request] Scripting support in RSS Feeds

Post by hugbug » 30 Jun 2015, 21:54

Merged into develop.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests