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
Parse Informations of the RSS Feed into the Post-Processing
Re: Parse Informations of the RSS Feed into the Post-Process
Here's some ugly code to get the info.
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.
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:~$
Re: Parse Informations of the RSS Feed into the Post-Process
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
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
The 'mang wget' says this:
HTH
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.
Re: Parse Informations of the RSS Feed into the Post-Process
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:
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?
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>
Re: Parse Informations of the RSS Feed into the Post-Process
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.
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
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
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"%?
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
(If I understand you correctly, I would say this:)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"%?
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
I solved it by editing the link path with the save name I get from nzbindex.nl instead of the download link name.