The next release of UbuStream (v2.0) will include support for "mini-plugins" that will scrape content from web sites that publish on-demand streams (often updated daily). This will allow UbuStream users to watch the most recent streams without having to manually set them up as individual "Stations". I'm starting this thread so potential users (and authors) can discuss issues relating to the architecture for these "Dynamic Source" apps.
Overview
At startup, UbuStream will retrieve a list of all Dynamic Source applications in the gbpvr\Plugins\UbuStream\DynSource folder and, if not already present, will add them to the UbuStream database.
When the user views each Dynamic Source (using the UbuStream config app) the DynSource app will be asked to publish a list of "sections" available on its target web site. The user can then select the sections from which they want to receive automatically updated content and, for each section selected, UbuStream will create a "Station Group" (this is a new feature in UbuStream v2.0).
At run time (when selected from the GB-PVR menu), UbuStream will call the DynSource app, read the playlist file it produces and populate the Station Groups with the new items (for those sections they have selected).
Dynamic Source Applications
A Dynamic Source application has two execution modes. If executed with the parameter "-sections" it will produce a file containing the section names available on the target site. Executing it with no parameters will produce a file of all the currently available stream items in all sections.
For a mini-plugin that targets a site that doesn't have "sections", the section name in the output could just be hard-coded by the author and a single "Station Group" would be created with that name.
Provided the app conforms to the naming standards and file formats described below, it can be written in any language and use whatever technique the author chooses. However, to make coding a DynSource app easier and to encourage people to "have a go" at authoring one, a common class library (DynamicSource.dll) will be provided that will take care of most of the heavy lifting (see description below). Using this library, authors can write a simple program in any .Net compliant language (C#, VB, Python, etc.) that contains one method to parse a web page for section names and another method to parse a page for stream URLs.
Naming standards
Dynamic Source name: <name> (eg. CNN)
Mini-plugin app: <name>DynSource.exe (eg. CNNDynSource.exe).
Sections file: <name>Sections.plx (eg. CNNSections.plx)
Playlist file: <name>Playlist.plx (eg. CNNPlaylist.plx).
PLX file formats
Although the Dynamic Source file format is based on the widely accepted standard PLS format, some liberties are taken with the original format, so the files should be given the extension '.plx' (PlayList eXtended).
for playlist file:
[playlist]
File1=<item stream url>
Section1=<name of section containing this item>
Player1=<(optional} name of media player to be used for this item's stream>
Type=[I]<(optional) stream type (Audio or Video)>
Description1=<(optional) item description text>
Website1=<(optional) url of a web page containing schedule info>
Title1=<item name>
for sections file:
[sections]
Player=<optional name of media player to be used for this section's streams>
Section1=<name of section>
Notes:
- "Optional" lines may be omitted.
- The Player1 line in the playlist file allows the default player for the Dynamic Source to be
overridden for that item. If omitted, the default player will be used.
- The Player line in the sections file declares the default player for the Dynamic Source streams
and should only occur once. If omitted, UbuStream will use the player entered in the config panel.
- If the Type line is omitted, UbuStream will default to "Video". This is only required for Audio streams.
DynamicSource.dll class library
The class library provides two methods which may be overridden by any class in the DynSource app which inherits the DynamicSource class:
Overview
At startup, UbuStream will retrieve a list of all Dynamic Source applications in the gbpvr\Plugins\UbuStream\DynSource folder and, if not already present, will add them to the UbuStream database.
When the user views each Dynamic Source (using the UbuStream config app) the DynSource app will be asked to publish a list of "sections" available on its target web site. The user can then select the sections from which they want to receive automatically updated content and, for each section selected, UbuStream will create a "Station Group" (this is a new feature in UbuStream v2.0).
At run time (when selected from the GB-PVR menu), UbuStream will call the DynSource app, read the playlist file it produces and populate the Station Groups with the new items (for those sections they have selected).
Dynamic Source Applications
A Dynamic Source application has two execution modes. If executed with the parameter "-sections" it will produce a file containing the section names available on the target site. Executing it with no parameters will produce a file of all the currently available stream items in all sections.
For a mini-plugin that targets a site that doesn't have "sections", the section name in the output could just be hard-coded by the author and a single "Station Group" would be created with that name.
Provided the app conforms to the naming standards and file formats described below, it can be written in any language and use whatever technique the author chooses. However, to make coding a DynSource app easier and to encourage people to "have a go" at authoring one, a common class library (DynamicSource.dll) will be provided that will take care of most of the heavy lifting (see description below). Using this library, authors can write a simple program in any .Net compliant language (C#, VB, Python, etc.) that contains one method to parse a web page for section names and another method to parse a page for stream URLs.
Naming standards
Dynamic Source name: <name> (eg. CNN)
Mini-plugin app: <name>DynSource.exe (eg. CNNDynSource.exe).
Sections file: <name>Sections.plx (eg. CNNSections.plx)
Playlist file: <name>Playlist.plx (eg. CNNPlaylist.plx).
PLX file formats
Although the Dynamic Source file format is based on the widely accepted standard PLS format, some liberties are taken with the original format, so the files should be given the extension '.plx' (PlayList eXtended).
for playlist file:
[playlist]
File1=<item stream url>
Section1=<name of section containing this item>
Player1=<(optional} name of media player to be used for this item's stream>
Type=[I]<(optional) stream type (Audio or Video)>
Description1=<(optional) item description text>
Website1=<(optional) url of a web page containing schedule info>
Title1=<item name>
for sections file:
[sections]
Player=<optional name of media player to be used for this section's streams>
Section1=<name of section>
Notes:
- "Optional" lines may be omitted.
- The Player1 line in the playlist file allows the default player for the Dynamic Source to be
overridden for that item. If omitted, the default player will be used.
- The Player line in the sections file declares the default player for the Dynamic Source streams
and should only occur once. If omitted, UbuStream will use the player entered in the config panel.
- If the Type line is omitted, UbuStream will default to "Video". This is only required for Audio streams.
DynamicSource.dll class library
The class library provides two methods which may be overridden by any class in the DynSource app which inherits the DynamicSource class:
- Get_Sections()
- Get_Section_Items(SiteSection section)
- Read_HTML_Page(String targURL)
- Publish_Section_Names(String dynSourceName, String dynSourcePlayer)
- Publish_Site_Items(String dynSourceName)
- Write_Sections_File(ArrayList sectionList, String dynSourcePlayer, String plxFile)
- Write_Playlist_File(ArrayList itemList, String plxFile)
- Get_Gbpvr_DynSource_Folder_Name()
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.