[RELEASE] FlexiBrowser (Script)
#1
Thumbs Up 
I posted my FlexiBrowser script in the old python scripts support and request forum (see here) in march. this was mainly for users.

This thread is also for other python developers to show how to easy it is to extend FlexiBrowser by creating plugins for it.

what is flexibrowser (the vision):
in short terms flexibrowser is an attempt to make a 'multi browser'. one browser that shows media from serveral sources in a filemanager like fashion.
it should be some kind of framework so people can create new content without having to clone some other script over and over again. the idea of code reuse through copy/paste isn't very good
to be able to browse a new website one should only need to write code which does the parsing and is specific for that site, but not the gui and the http reading which is mainly always the same.

how does flexibrowser work
flexibrowser seperates gui from parsing. it uses plug-ins to to the parsing. the gui-script calls the plug-ins to populate its list with elements. each element can then be asked whethe it has subelements, which will be retrieved when the user selects this element in the gui.
in that flexibrowser creates a hierchical (folder like) way of browsing.
the plug-ins are created as seperate .py files and stored in a subfolder.
to install a new plug-in you just have to copy the it to the "plugins" subfolder and the next time you start flexibrowser you will be able to browse new content.

the good thing about seperating the parsing from the gui is that as a plug-in developer you can write an test your plug-in completely on your pc/mac/whatever.
since no xbmc specific code is needed (its all in the gui script) you don't need the emulator to create a plug-in. this greatly decreases testing and debugging, because you can do it with simple print statements

how to create a plug-in
1. create a new scriptfile in the plugins folder and name it plug_myplugin.py you must prefix the name with "plug_"
2. import flexibrowser and whatever other libs your need.
3. derive your class/classes from <span style='font-family:courier'>flexibrowser.flexielement</span> call the baseclass contructor (flexielement._init_) in your _init_*to get html decoding for free.
overload <span style='font-family:courier'>getsubelements()</span> and do your own regex parsing and return a list of subelements
4. provide a global <span style='font-family:courier'>getflexibrowserelements()</span> function and return a list of flexielement based objects you plug-in provides.

the flexibrowser module contains some general purpose function your plug-in may use like fetchhtmlpage or decodehtml which should be used by plug-ins so you don't have to recode them everytime.

see the provided plug-ins (plug_channel9.py for a simple or plug_teamxbox.py for a more sophisticated one with subelements) for samples.

the future
flexibrowser is not perfect yet :d

here are some things i thought could be impreoved:
-needs much more plug-ins. the more the better Smile
-the gui looks functional but not fancy
-the gui doesn't display all information a flexielement can provide (description, thumbnail) yet
-at this time flexibrowser only plays videos. it could be improved so it will also handle images and texts (like phuncks ooba.py). this would be great for comics, game faqs, etc
-it is missing a configuration screen. the only thing you can configure is whether the videos will be streamed or downloaded by pressing x
-a global tempfile management would be great, so plug-ins could store some data
-an autoupdate function to download new plug-ins would be nice

everyone is invited to extend flexibrowser and to make it the most flexible browser script.

you can grab the latest flexibrowser at xbmcscripts.com in the media: streaming section

thanks
bernd
Reply


Messages In This Thread
[RELEASE] FlexiBrowser (Script) - by Bernd - 2005-04-10, 15:47
[No subject] - by Phunck - 2005-04-11, 10:56
[No subject] - by Bernd - 2005-04-12, 00:03
[No subject] - by Phunck - 2005-04-12, 09:09
[No subject] - by Bernd - 2005-04-14, 00:14
[No subject] - by Bernd - 2005-04-14, 00:22
[No subject] - by jmarshall - 2005-04-14, 09:17
[No subject] - by Phunck - 2005-04-14, 13:16
[No subject] - by jmarshall - 2005-04-14, 14:25
[No subject] - by jmarshall - 2005-04-14, 15:37
[No subject] - by Asteron - 2005-04-14, 16:36
[No subject] - by jmarshall - 2005-04-14, 16:45
[No subject] - by Bernd - 2005-04-21, 00:32
[No subject] - by Livin - 2005-04-21, 01:21
[No subject] - by Bernd - 2005-04-21, 23:42
[No subject] - by bakman - 2005-04-24, 17:39
[No subject] - by Bernd - 2005-04-25, 00:10
[No subject] - by zhugeliang - 2005-05-13, 17:55
[No subject] - by Bernd - 2005-05-14, 02:58
[No subject] - by zhugeliang - 2005-05-14, 20:37
[RELEASE] FlexiBrowser 1.3 Script - by Bernd - 2005-05-16, 02:29
[No subject] - by Bernd - 2005-05-16, 13:22
[No subject] - by mikenewf - 2005-05-16, 20:33
[No subject] - by Bernd - 2005-05-17, 00:58
[No subject] - by mikenewf - 2005-05-17, 01:14
[No subject] - by Bernd - 2005-05-18, 00:21
[No subject] - by mikenewf - 2005-05-18, 06:04
[No subject] - by mikenewf - 2005-05-18, 22:21
[No subject] - by Livin - 2005-05-18, 22:58
[No subject] - by mikenewf - 2005-05-18, 23:01
[No subject] - by mikenewf - 2005-05-19, 00:06
[No subject] - by mikenewf - 2005-05-19, 00:10
[No subject] - by Livin - 2005-05-19, 00:19
[No subject] - by Phunck - 2005-05-19, 13:01
[No subject] - by Livin - 2005-05-19, 16:33
[No subject] - by Paulitix - 2005-05-25, 17:48
[No subject] - by Bernd - 2005-05-25, 23:40
[No subject] - by Paulitix - 2005-05-26, 18:11
[No subject] - by mortael - 2005-05-27, 05:49
[No subject] - by dazzler - 2005-05-27, 21:36
[No subject] - by Paulitix - 2005-05-28, 04:20
[No subject] - by Bernd - 2005-05-29, 18:27
[No subject] - by Bernd - 2005-05-30, 00:27
[No subject] - by RocafellaSqualie - 2005-05-30, 16:00
[No subject] - by XBoxgeek - 2005-05-30, 19:59
[No subject] - by mortael - 2005-05-30, 20:20
[No subject] - by EnderW - 2005-05-30, 20:33
[No subject] - by RocafellaSqualie - 2005-05-30, 20:40
[No subject] - by Bernd - 2005-05-31, 00:08
[No subject] - by joaomgcd - 2005-07-15, 11:14
[No subject] - by dazinith - 2005-08-02, 08:19
[No subject] - by Bernd - 2005-08-03, 00:40
[No subject] - by dazinith - 2005-08-03, 00:53
[No subject] - by Bernd - 2005-08-03, 01:02
[No subject] - by dazinith - 2005-08-03, 08:06
[No subject] - by Der Hesse - 2005-08-03, 16:32
[No subject] - by Bernd - 2005-08-03, 22:33
[No subject] - by Bernd - 2005-08-03, 22:53
[No subject] - by Bernd - 2005-08-14, 20:45
[No subject] - by zhugeliang - 2005-08-14, 22:16
[No subject] - by thor918 - 2005-08-15, 00:25
[No subject] - by Bernd - 2005-08-16, 00:43
[No subject] - by zhugeliang - 2005-08-16, 03:28
[No subject] - by HarshReality - 2005-10-15, 21:09
[No subject] - by Bernd - 2005-10-18, 02:11
Logout Mark Read Team Forum Stats Members Help
[RELEASE] FlexiBrowser (Script)0