Alter download history RSS feed?
Posted: July 21st, 2011, 3:18 pm
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.
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:
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,
Axel
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.
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 cAny help is much appreciated!
Thanks,
Axel