[REQUEST] Would like to improve the RSS feed grabbing when more than 1 link element is present

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
Posts: 2
Joined: 20 Mar 2019, 07:45

[REQUEST] Would like to improve the RSS feed grabbing when more than 1 link element is present

Post by newbpy » 20 Mar 2019, 09:14

Any help on below is appreciated or if this has been discussed before, would appreciate a pointer in the right direction. :D

I am trying to configure anime feed from Anime Tosho feed in nzbget so I can pull specific nzb files directly via RSS.

replace feedsite with animetosho
Feed URL: feed.feedsite.org/rss2?q=1080p

Here is sample of atom feed modified to make it easier to read.
As you see the entry element has 4 link (alternate, x-bittorrent, x-nzb, detail html link).

When pulling from feed, nzbget attempts the first link resulting in error. Can anyone suggest a way (scripted or program parameters) that will allow me to target link where application type parameter is x-nzb so that nzb file is grabbed correctly.

of the 4 links in the entry, only application/x-nzb type entry has nzb file
<link href="https://feedsite.org/nzb/000489f4/Real%20Girl.nzb" rel="enclosure" type="application/x-nzb"/>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org....">
<subtitle>Latest releases feed</subtitle>
<link href="https://feed.feedsite.org/atom" rel="self" type="application/atom+xml"/>
	<title>Real Girl - 23 [1080p].mkv</title>
	<content type="html"><![CDATA[<strong>.....]]></content>
	<link href="https://feedsite.org/view/real-girl-23-1080p-mkv.1321099" rel="alternate" type="text/html"/>
	<link href="https://feedsite.org/torrents/Real%20Girl.torrent" rel="enclosure" type="application/x-bittorrent"/>
	<link href="https://feedsite.org/nzb/000489f4/Real%20Girl.nzb" rel="enclosure" type="application/x-nzb"/>
	<link href="https://www.feedsite.info/details.php?id=1321099" rel="via" type="text/html"/>
I have looked at feeds which are working an it seems that nzbget will always attempt to get the first link and fail if that is not nzb. I am hoping the developer could modify the RSS feed to check if more than 1 link is given in entry element, if so check if link has application type attribute such as x-nzb and if so, pull only that link, otherwise fallback to first link in entry element for nzb grab. Or hoping someone can give me some pointer so I can script to achieve the same result.

Code: Select all

<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<generator>myfeeder rss feeds generator</generator>
<title>myfeeder - Examplefeed</title>
<description>myfeeder - NZB Download Feed (true)</description>
<copyright>2018 myfeeder</copyright>
<atom:link href="https://rss.myfeeder/rss-search.php?search=gooday" rel="self" type="application/rss+xml"/>
<pubDate>Mon, 1 Mar 2019 20:54:27 +0200</pubDate>
<b>Title:</b> Good.day.chappy<br /><b>Category:</b> Anime: HD-CLIPS<br /><b>Size:</b> 1.6 GB<br /><b>Group:</b> alt.binaries.anime<br /><b>Added to index:</b> 18/01/2019 20:54:16<br />
<category>Anime: HD-CLIPS</category>
<enclosure url="https://api.myfeeder/nzb/?id=WYSIWYG&user=tester&api=123123123123123" length="1460832860" type="application/x-nzb"/>

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

Re: [REQUEST] Would like to improve the RSS feed grabbing when more than 1 link element is present

Post by hugbug » 20 Mar 2019, 09:47

Feeds can be processed by extension scripts. Therefore you could write an extension script which would modify the feed and tranform it to a feed which nzbget can correctly process.

After the feed is fetched nzbget executes the script, the script reads the feed content from a file provided by nzbget, teh script can modify teh feed content and write it back into the file. After that nzbget reads the (modified) feed file and processes it.

As an example take a look at script [FeedScript] ImdbWatchlist - RSS with IMDb integration. That scritps reads the feed and removes some entries. Your script can do any modifications to the feed, whatever you need to make it compatible with nzbget.

NOTE: ImdbWatchlist-script has performance optimizations when parsing xml and therefore is more complex in that regard than it could be. If you have a proper hardware (not RPi 1 for example) you could use python's built-in xml parsing functions instead for much simpler code.

Posts: 2
Joined: 20 Mar 2019, 07:45

Re: [REQUEST] Would like to improve the RSS feed grabbing when more than 1 link element is present

Post by newbpy » 22 Mar 2019, 04:21

Thanks hugbug.

I have started to modify the script and should have something ready this weekend to do this.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest