Page 1 of 1
Parse Informations of the RSS Feed into the Post-Processing
Posted: November 14th, 2011, 5:27 pm
by CoDeX2k
Hello,
I wanted to ask if I can somehow access <item><title> and <item>description> of the rss feed I am importing into sabnzbd for post processing?
For example:
<item>
<title>Test.Movie.XViD-TestGroup</title>
<link>
http://www.testnzb.com/test.nzb</link>
<description>
http://www.imdb.com/title/tt0000000/</description>
<pubDate>Mon, 14 Nov 2011 21:47:06 GMT</pubDate>
</item>
So I can access the title and the description for post-processing.
Would be cool for my script.
Thanks a lot for your help guys.
Cheers,
CoDeX2k
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 15th, 2011, 1:07 pm
by sander
Here's some ugly code to get the info.
Code: Select all
sander@R540:~$ cat rss-stuff.txt | grep '<title>' | awk -F\> '{ print $2 }' | awk -F\< '{ print $1 }'
Test.Movie.XViD-TestGroup
sander@R540:~$
sander@R540:~$
sander@R540:~$ cat rss-stuff.txt | grep '<description>' | awk -F\> '{ print $2 }' | awk -F\< '{ print $1 }'
http://www.imdb.com/title/tt0000000/
sander@R540:~$
But it all depends on the OS you're using, ... which you didn't specify. And it depends on the programming language you're able to program yourself.
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 16th, 2011, 4:47 am
by CoDeX2k
Hi Sander,
Thanks a lot for your reply.
I wanted to do this script on my QNap NAS. Which is Linux based. So the code you wrote helps me a lot.
Just to make sure I am dont missing something. I have to wget the rss.xml first to make the cat etc. stuff with it. Right? I can not cat something from the web?
Cheers
CoDeX2k
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 16th, 2011, 4:57 am
by sander
The 'mang wget' says this:
Code: Select all
-O file
--output-document=file
The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents
will be printed to standard output, disabling link conversion.
HTH
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 16th, 2011, 5:17 am
by CoDeX2k
Wow. Thanks for the fast reply.
Works.
One last thing. Now I know how to access the <title> and <description> of this rss.xml but how can I compare my test.nzb to the right item entry of this .xml? Because lets say the xml looks like this:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>RSS Feed</title>
<link>rss.asdfasdf.com</link>
<description>RSS Feed</description>
<copyright>Blablabla</copyright>
<ttl>5</ttl>
<lastBuildDate>Tue, 15 Nov 2011 17:22:08 GMT</lastBuildDate>
<item>
<title>Test.Movie.XViD-TestGroup</title>
<link>http://www.testnzb.com/test.nzb</link>
<description>http://www.imdb.com/title/tt0000000/</description>
<pubDate>Mon, 14 Nov 2011 22:18:18 GMT</pubDate>
</item>
<item>
<title>Test.Movie.2.XViD-TestGroup</title>
<link>http://www.testnzb.com/test1.nzb</link>
<description>http://www.imdb.com/title/tt0000001/</description>
<pubDate>Mon, 14 Nov 2011 21:47:06 GMT</pubDate>
</item>
</channel>
</rss>
And now sabnzbd downloads the test.nzb how can I compare the test.nzb (variable $2 if I am correct) with the full xml and only get the <title> and <description> of the correct item back?
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 16th, 2011, 6:25 am
by Mar2zz
if grep $2 rss.xml; then etc
only these
grep '<description>' rss.xml | sed 's/<*escription>//g'
grep '<title>' rss.xml | sed's/<*itle>//g'
grep has more function if multiple title/descriptions are found.
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 16th, 2011, 4:36 pm
by exussum
The way ive done it in the past is set the rss feed to be a php script i have control of which accesses the RSS feed and passes any extra info needed to it. May be a bit overkill though
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 17th, 2011, 7:17 am
by CoDeX2k
I am having troubles with the $2 variable because its not really the link variable it is the download name...
for example:
<link>TOWN-www.town.ag-sponsored-by-www.ssl-news.info-Alles.Koscher.DVDRiP.MD.German.XViD-CIS.par2-74422-MB.nzb</link>
is
Another.Earth.BDRip.MD.German.XViD-CIS.par2
is there a trick? or should I just search for %"$2"%?
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 17th, 2011, 7:57 am
by sander
CoDeX2k wrote:I am having troubles with the $2 variable because its not really the link variable it is the download name...
for example:
<link>TOWN-www.town.ag-sponsored-by-www.ssl-news.info-Alles.Koscher.DVDRiP.MD.German.XViD-CIS.par2-74422-MB.nzb</link>
is
Another.Earth.BDRip.MD.German.XViD-CIS.par2
is there a trick? or should I just search for %"$2"%?
(If I understand you correctly, I would say this:)
The download name can be completely unrelated; it can be even be "3838329802.NZB"; that filename is generated by the search engine (like binsearch.info), or more generally speaking: the webserver providing the .NZB file. The linking pin is *in* that NZB. So maybe you can find the NZB, and then search it?
Re: Parse Informations of the RSS Feed into the Post-Process
Posted: November 17th, 2011, 12:41 pm
by CoDeX2k
I solved it by editing the link path with the save name I get from nzbindex.nl instead of the download link name.