[Feature Request] Support for Custom Variables in RSS

Discuss newly added features or request new features.
Post Reply
silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

[Feature Request] Support for Custom Variables in RSS

Post by silhouette » 12 Dec 2018, 08:56

It would be great if we could set custom variables in the rss feed.

Support for variables, would make the RSS support much more flexible.

I use an RSS feed which is not and will not be formatted properly for automatic duplicate detection.

However the feed does contain information which could be used to create a proper dupekey using RegEX.

If it was possible to use variables, it would be possible to use dupe detection for feeds, which contain the relevant information, but which are not properly formatted.

This particular feed includes a link to imdb.com in the description.

<description>
<![CDATA[
<p><font color="gray">HD / 1080p</font><br /><b>xx.xx GB</b><br /><font color="#E5B439">Password: xxxxxxx</font><br /><br />Link: <a href="https://www.imdb.com/title/tt0804540/">https://www.imdb.com/title/tt0804540/</a><br />IMDB Rating: 5.5<br /><br />-</p>
]]>
</description>

The IMDB ID can easily be retrieved using the following RegEX:

(com/title/tt)(.*?)(/\"\>https)

Which returns: 0804540

It would be useful, if such information could be stored in a variable.

Variable#1 = Description:(com/title/tt)(.*?)(/\"\>https)

The variable could be used to define a proper dupekey, even if it isn't supported by the feed.

Dupekey:imdb=$Variable#1


I have already modified '[FeedScript] ImdbWatchlist - RSS with IMDb integration' to work with this custom RSS Feed.
I also made a few very minor adjustments to make the script identify the id's based on the http code, seeing that rss is no longer an available.

On another note:

As you can see this feed also contains the UnRAR password. It might make sense, if there was a password variable. The password variable would be used for defining the UnRAR password using RegEX.

This particular feed also has the password embedded in the title, so the password part it isn't necessary for this use case.

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

Re: [Feature Request] Support for Custom Variables in RSS

Post by hugbug » 12 Dec 2018, 09:57

You can use regex in rss filter and you can use matches from regex when setting dupekey. Something like this:

Code: Select all

Options(dupekey:imdbid=tt${2}): description:$(com/title/tt)(.*?)(/.\>https)
In the dupekey ${2} refers to second match group.

Not relevant: I had to replace \" with . because nzbget's filter editor couldn't process \".

silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

Re: [Feature Request] Support for Custom Variables in RSS

Post by silhouette » 12 Dec 2018, 10:16

I did suspect, that it would already be possible.

Thank you :D

silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

Re: [Feature Request] Support for Custom Variables in RSS

Post by silhouette » 27 Dec 2018, 08:26

Possible minor bug.

The RSS filter won't match on imdbid, if the imdbid starts with a 0.
For imdbid 0804540 in the rss feed.
The following doesn't match 0804540.
imdbid:0804540
If you remove the leading zero, the rss filter matches 0804540:
imdbid:804540

In case you are wondering, in the rss feeds, the zeros are there.

The leading zero also appears to be removed from the dupekeys. As this is consistent it would probably be fine for dupe handling.

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

Re: [Feature Request] Support for Custom Variables in RSS

Post by hugbug » 27 Dec 2018, 13:48

That's OK.

"imdbid" is an integer field. When you use string comparison (imdbid:01234567) the integer value parsed from rss feed is converted into text and then compared to string "01234567". You could use integer comparison instead (imdbid:=01234567); in that case the value "01234567" is converted into integer first.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests