SbsOnDemand
|
This package is designed to help third-party applications to interface with the SBS On Demand service without worrying about the underlying complexity
The module is object-oriented, however it is recommended that you let the package create the objects using either the static functions within each module or calling an object's method rather than directly using the class constructors. Properties are either pre-populated or are populated on request.
Video feeds can be retrieved using static methods in Feed.
This example finds all the feeds from the SBS On Demand menu, and chooses the one entitled 'Program'
import sbs.Feed feeds = sbs.Feed.getMenuFeeds() feed = feeds['Programs']['feed']
This example prints the title of each video in the feed
for video in feed.videos: print video.title
This example gets a video object for a specific video ID, and then prints the video's title
import sbs.Video video = sbs.Video.getVideo(videoID) print video.title
This example uses the video object from Example 1, gets all the media associated with it, and then prints each media with its (rtmp) url parameters
for media in video.media['content']: print media.bitrate, media.baseUrl, media.videoUrl