FAQ  •  Register  •  Login

Question about ContentURLContainer for rss feeds

<<

WindWalker

Streaming enthusiast

Posts: 20

Joined: Wed Feb 09, 2011 3:09 am

Post Thu Jan 19, 2012 8:38 am

Question about ContentURLContainer for rss feeds

Hi all,

I'm writing a plugin for an rss feed, and the current API documentation from viewtopic.php?f=22&t=3274 is not clear about the live property being supported in this context.

Page 6 does not list it in the function header example but page 7 lists it in the description.

Either way when I try to run the code and set a stream as live I get this error for every entry in the RSS:

  Code:
2012-01-18 22:12:49,886 DEBUG [FeedItemUrlExtractor] InternodeLiveRadioFeeds: Starting extraction of url for item: EYE97
2012-01-18 22:12:49,887 DEBUG [FeedParser] Unexpected error during url extractor plugin invocation (InternodeLiveRadioFeeds) for item EYE97: No such property: live for class: InternodeLiveRadioFeeds


I'm confused - help! :lol: :oops:
Last edited by WindWalker on Thu Jan 19, 2012 10:21 am, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 19, 2012 9:44 am

Re: Question about ContentURLContainer for rss feeds

ContentURLContainer is your return type so you have to build this object. One of it's properties is live by which you tell Serviio that the content is a live stream.
<<

WindWalker

Streaming enthusiast

Posts: 20

Joined: Wed Feb 09, 2011 3:09 am

Post Thu Jan 19, 2012 10:23 am

Re: Question about ContentURLContainer for rss feeds

Hmm I cut down my code to the bare bones and now it seems to work! :D

So is there anything wrong with using the following code to extract live feeds from an rss?

  Code:
class InternodeLiveRadioFeeds extends FeedItemUrlExtractor {

   final VALID_FEED_URL = 'http://feeds.internode.on.net/radio.rss'
   
   String getExtractorName() {
      return getClass().getName()
   }
   
   boolean extractorMatches(URL feedUrl) {
      return feedUrl ==~ VALID_FEED_URL   
      }

   ContentURLContainer extractUrl(Map links, PreferredQuality requestedQuality) {
      return new ContentURLContainer(fileType: MediaFileType.AUDIO, contentUrl: links.default, live: true)
   }

   static void main(args) {
   
      // this is just to test
        InternodeLiveRadioFeeds extractor = new InternodeLiveRadioFeeds()
      
      // check the url matching
      assert extractor.extractorMatches( new URL("http://feeds.internode.on.net/radio.rss") )
      
    }
   
}
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 19, 2012 11:37 am

Re: Question about ContentURLContainer for rss feeds

that looks fine
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Sat Jan 28, 2012 4:49 pm

Re: Question about ContentURLContainer for rss feeds

WindWalker wrote:I'm writing a plugin for an rss feed

You might want to check out this wiki for the plugin that already exists for live feed rss's: How To Create RSS Folders of your Live Streams (0.6.1+)
http://wiki.serviio.org/doku.php?id=live_stream_folders

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 20 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.