NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) UbuStream, Web Radio and Universe v
« Previous 1 … 4 5 6 7 8
UbuStream Dynamic Source "mini-plugin" architecture for on-demand streams

 
  • 0 Vote(s) - 0 Average
UbuStream Dynamic Source "mini-plugin" architecture for on-demand streams
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#1
2006-11-06, 11:44 PM (This post was last modified: 2006-11-24, 06:08 PM by ubu.)
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:
  • Get_Sections()
  • Get_Section_Items(SiteSection section)
and some "utility" methods which may be called by the DynSource app (usually you won't need to):
  • 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()
I will be providing a "beta" version of the dll, together with some sample DynSource apps, very soon. Watch this thread.
[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.
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#2
2006-11-09, 11:13 PM (This post was last modified: 2006-11-10, 11:20 PM by HTPCGB.)
Attached is the updated CNN mini-plugin.
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#3
2006-11-10, 05:07 AM (This post was last modified: 2006-11-10, 10:56 AM by ubu.)
HTPCGB Wrote:Attached is the updated CNN mini-plugin.
Excellent! Works fine. Three very minor points:

1) The first line of the Sections file should be [sections] not [playlist]. It will work OK in either case currently but I'm reserving the right to require the corect header in the future. (And it would be good if the output of your "mini-plugin" and the output of mine have identical formats).

2) If you add the line Player=Windows Media Player as the second line of the Sections file, it will ensure that the correct media player will be used for playing the streams associated with your DynSource. It'll work OK without it, but the user will then have to remember to manually select the correct player for the CNN DynSource in the UbuStream config app before using your app for the first time.

3) Your app is currently placing the output files in the current directory from which it is executed (which I agree is normal behaviour for this kind of app). When run from a GB-PVR plugin, this puts them in the gbpvr directory and, in an attempt to keep from cluttering up that directory, I've been putting my plx files in the gbpvr\Plugins\UbuStream\DynSource directory. I just do something like:
Code:
String playlistFile = myDynSourceApp.Replace("DynSource.exe", "Playlist.plx");
String sectionsFile = myDynSourceApp.Replace("DynSource.exe", "Sections.plx");
inside my mini-plugin app. This ensures that the output files always end up in the same directory as the app itself. If you prefer to stick with using the current directory, I can change UbuStream (and my mini-plugin dll) to do that instead. It's just a little simpler for me to keep everything in the DynSource folder though. It's your call. Let me know which you prefer.

Thanks for the rapid turnaround. I'm very close to completing this now.
[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.
stefan
Offline

Posting Freak

Posts: 3,116
Threads: 81
Joined: Oct 2004
#4
2006-11-10, 07:25 AM
Cool... Smile I managed to add like 40 or so "SR" (Swedish national radio) to the worldwidemediaproject: http://www.worldwidemediaproject.com/rad...&genre=all

But realize that the URIConfused might change over time. Would be cool to write a mini-plugin for them, but I wouldn't know where to start. I'm a java programmer, so I don't have a clue how to write c#... perhaps not too hard to learn at least the basics, but it'd be a lot easier if I had a starting point Smile Is there any example source code I could start with?
I'm not always right
GB-PVR 1.2.9
Accent HT-400 Case, AMD Athlon 64 3800+ 1024MB, 1TB+300GB+180GB, WinXP Pro-SP2, NVidia 7600GT
Nova-T USB2, PVR-350 recording from Dilog 355 DVB-T box, USB-UIRT (receiving & transmitting)
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#5
2006-11-10, 10:54 AM
stefan Wrote:Cool... Smile I managed to add like 40 or so "SR" (Swedish national radio) to the worldwidemediaproject: http://www.worldwidemediaproject.com/rad...&genre=all

But realize that the URIConfused might change over time. Would be cool to write a mini-plugin for them, but I wouldn't know where to start. I'm a java programmer, so I don't have a clue how to write c#... perhaps not too hard to learn at least the basics, but it'd be a lot easier if I had a starting point Smile Is there any example source code I could start with?
I'm just about finished with the class library and sample mini-plugin apps (see my first post in ths thread) so I'll be "publishing" it here. If you already write java you should have no problem modifying one of my sample apps to your needs. C# isn't wildly different from java.

You just need to write two simple methods. The class library methods will load HTML into a string for you, so you'll just need to parse the string to find your URIs and stick them into a collection. (I use regular expressions to do this, because I'm comfortable with using them, but any string-slicing technique is fine). The class library will take care of writing the collection to the output file. In fact you don't even need to use C#. The class library should work with any .Net compatible language as long as it allows you to inherit the main DynamicSource class and override a couple of methods.
[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.
stefan
Offline

Posting Freak

Posts: 3,116
Threads: 81
Joined: Oct 2004
#6
2006-11-10, 10:55 AM
Looking forward to it, but not promising anything. But it would be fun Smile
I'm not always right
GB-PVR 1.2.9
Accent HT-400 Case, AMD Athlon 64 3800+ 1024MB, 1TB+300GB+180GB, WinXP Pro-SP2, NVidia 7600GT
Nova-T USB2, PVR-350 recording from Dilog 355 DVB-T box, USB-UIRT (receiving & transmitting)
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#7
2006-11-10, 09:52 PM (This post was last modified: 2006-11-10, 10:19 PM by ubu.)
Remco Wrote:I'll give it a try for Uitzendinggemist (a Dutch site which streams shows that have been on TV last week)

Personally, i would prefer exchanging data via classes in dll's instead of via .pls/.plx-files. Currently i've got a prototype up-and-running of a webvideo-plugin that uses dll's for specific website-parsers.
That would be great. HTPCGB has one working for CNN, I've got 3 going (BBC, Mosaic and DemocracyNow) so, if you add one for Uitzendinggemist, maybe it's time for me to start thinking about a wiki sub-page for Dynamic Source mini-plugins.

I thought about using classes instead of files for the data interchange but:

1) I want the mini-plugin apps to be both easy to write and not too dependant on any particular programming environment. Right now, you can write a Dynamic Source app in any language (Lisp, REXX - Fortran even) and, as long as the app can write its output in the plx format, it will work fine within the Dynamic Source architecture. Using a class to transfer the data would have constrained the apps to be written in .Net languages. (However, for those people who are using .Net languages, I'm providing the DynamicSource.dll class library so they don't have to reinvent the wheel.)

2) UbuStream lets users invoke the app both in real-time and background mode. When they click an "AutoSynch" button the mini-plugin app is invoked to scrape the data and, when it completes, the data is imported. For this, using classes instead of files would have worked OK. But there is also an option to run the apps in background mode, with no user interaction required. Each time UbuStream starts up, the app is fired off in a separate process, allowing UbuStream to continue without any noticable delay. A FileSystemWatcher object monitors the plx files and, when one changes, triggers the data import method(s) . I imagine you could arrange to do something similar using classes instead of files but I suspect it would involve complex thread management code (way above my pay grade - or maybe I'm just too lazy Wink ).

Is there some way we could integrate your existing work into this architecture? A wrapper that would dump your dll data into a file, perhaps?
[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.
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#8
2006-11-10, 11:19 PM (This post was last modified: 2006-11-11, 02:48 AM by HTPCGB.)
Sorry for the silly mistakes, that's what I get for coding while watching TV.Big Grin
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#9
2006-11-11, 01:40 AM
HTPCGB Wrote:Sorry for the silly mistakes, that's what I get for coding while watching TV.Big Grin
The file format is perfect now. However, the files are still getting created in the current directory (the folder it's being executed from) and not in the directory where the app resides (see item 3 in my earlier post). Is that what you intended?
[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.
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#10
2006-11-11, 01:57 AM (This post was last modified: 2006-11-11, 01:07 PM by HTPCGB.)
Edit: I'm pretty sure that this should work now.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (6): 1 2 3 4 5 6 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Universe or Network Tuner plugin for PIP greg in kansas 8 10,958 2016-03-13, 02:20 AM
Last Post: greg in kansas
  Universe plugin update mvallevand 0 4,798 2015-10-02, 11:55 PM
Last Post: mvallevand
  universe and live streams from PlayOn johnsonx42 2 6,388 2012-08-11, 03:51 AM
Last Post: johnsonx42
  Universe Plugin Setup mvallevand 4 12,060 2011-01-25, 01:41 AM
Last Post: mvallevand
  Universe Plugin on NMT Azimuth 3 6,160 2011-01-22, 08:40 PM
Last Post: mvallevand
  Some challenges with Universe Plugin cooper43 7 5,516 2010-12-27, 01:50 PM
Last Post: cooper43
  Some challenges with Universe Plugin cooper43 0 2,258 2010-12-26, 06:37 PM
Last Post: cooper43
  Why doesn't this plugin work!?!? haarvik 18 9,647 2009-05-28, 01:14 AM
Last Post: cc1091
  Ubustream not working preview neither timeshitf play Toni 2 3,129 2009-05-27, 07:59 PM
Last Post: Toni
  Imposible to start ubustream Toni 3 3,183 2009-05-27, 12:02 PM
Last Post: Toni

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode