Alter download history RSS feed?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
axxoul
Newbie
Newbie
Posts: 3
Joined: July 21st, 2011, 2:01 pm

Alter download history RSS feed?

Post by axxoul »

Hi everyone! :)

I have been using Sabnzbd for a while now, and have installed it on a computer connected to my local network. I have created a small webpage that lets my housemates browse the download folders and stream movies from within the browser. 8)

Now I would like to add a "latest downloads" section on the website. The RSS feed found at http://localhost:8080/sabnzbd/rss?mode=history does exactly that but the links of each download points to the Newzbin.com post. :-\

Is there a way of changing that link so that it points to the download location on my hard drive? i.e rather than pointing to http://newzbin.com/browse/post/6079517 make it point to c:/downloads/movies/die-hard/ ?

The following is the code (I believe) generates the feed:

Code: Select all

    #Generates everything contained in a <channel> element
    def generateChannel( self ):
        contents = ""
        if ( self.channel.initialized() ):
            contents += "<channel>\n"
            contents += self.optionalWrite("title", self.channel.title );
            contents += self.optionalWrite("link", self.channel.link );
            contents += self.optionalWrite("description", self.channel.description );
            
            contents += self.optionalWrite("language", self.channel.language );
            contents += self.optionalWrite("copyright", self.channel.copyright );
            contents += self.optionalWrite("category", self.channel.category );
            contents += self.optionalWrite("managingEditor", self.channel.managingEditor );
            contents += self.optionalWrite("webMaster", self.channel.webMaster );
            contents += self.optionalWrite("pubDate", self.channel.pubDate );
            contents += self.optionalWrite("lastBuildDate", self.channel.lastBuildDate );
            contents += self.optionalWrite("docs", self.channel.docs );
            contents += self.optionalWrite("cloud", self.channel.cloud );
            contents += self.optionalWrite("ttl", self.channel.ttl );
            contents += self.optionalWrite("generator", self.channel.generator );     
            contents += self.optionalWrite("image", self.channel.image );
            contents += self.optionalWrite("rating", self.channel.rating );
            contents += self.optionalWrite("textInput", self.channel.textInput );
            contents += self.optionalWrite("skipHours", self.channel.skipHours );
            contents += self.optionalWrite("skipDays", self.channel.skipDays );
 
            contents += "\n" + self.generateItems() + "</channel>\n"
        else :
            contents = "[Channel not properly initialized.  "
            contents +="A required field is not set.(title/link/description]"
        
        return contents

    #Generates all items within a channel
    def generateItems( self ):
        c = ""
        for i in self.channel.items :

            c += "<item>"

            c += self.optionalWrite("title", i.title);
            c += self.optionalWrite("link", i.link );
            c += self.optionalWrite("description", i.description);
            c += self.optionalWrite("author", i.author );
            c += self.optionalWrite("pubDate", str(i.pubDate) )
            c += self.optionalWrite("category", i.category )
            c += self.optionalWrite("comments", i.comments )
            c += self.optionalWrite("guid", i.guid )
            c += self.optionalWrite("source", i.source )
            
            if ( i.enclosure.url != "" ):
                c+= "<enclosure url=\"" + i.enclosure.url + "\" "
                c+= "length=\"" + str(i.enclosure.length )+ "\" "
                c+= "type=\"" + i.enclosure.type + "\"/>\n"
                
            for k in i.nsItems.keys():
                c += self.optionalWrite( k , i.nsItems[ k ] )
            
            c += "</item>\n\n"
            
        return c
Unfortunately i don't know how to change it in order to get the links to show the download destination...

Any help is much appreciated!

Thanks, O0

Axel
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Alter download history RSS feed?

Post by shypike »

This has been asked before.
We cannot do that because SABnzbd cannot know the relation between the
internal paths and the external paths of the server.
Showing the internal paths would lead to endless support questions,
because it won't work in many cases.
axxoul
Newbie
Newbie
Posts: 3
Joined: July 21st, 2011, 2:01 pm

Re: Alter download history RSS feed?

Post by axxoul »

Thanks for the quick reply! Unfortunately the search term "RSS" doesn't return any results as it is only 3 characters long...

I already have a script that searches for files on a hard disk. I guess I could add a link that returns search results with the posts title..

PS: If I did have to change the links of the RSS feed, is the rsslib.py the correct file to be altering?

PS2: After looking in interface.py, I realised that you can point your browser to http://localhost:8080/history/ and it will display a searchable list of the latest downloads but all the pictures and links seem to be broken?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Alter download history RSS feed?

Post by shypike »

Since it's open source, you're free to do any patching.
But I'm not going to spend time on guiding you through it.
That's way to time-consuming for me.
BTW: rsslib.py is not part of SABnzbd, rss.py is.
I don't know by heart where the proper place is to patch.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Alter download history RSS feed?

Post by shypike »

Just use the API call for history.
That does contain local paths.
http://wiki.sabnzbd.org/api
axxoul
Newbie
Newbie
Posts: 3
Joined: July 21st, 2011, 2:01 pm

Re: Alter download history RSS feed?

Post by axxoul »

Yeah just saw the API yesterday! Thanks a lot for your help!
Post Reply