Web Media Browser
#1
enjoy the web media browser. currently it allows you to browse streams from tv4all and radiolocator. link: wmb v1.0

i've setup this project quite modular, so it is relatively simple to add other sites as well. use one of the existing wmbparser_*.py as an example, create your own and import it in wmb.py. and done...

when i've some time again i'll add a few other sites as well. but if someone else likes to add a site, please do :d (see readme.txt for some cryptic details...)



# how to use:
#############

+ install in scripts/webmediabrowser
+ start the webmediabrowser with "wmb.py", not the other scripts!



# changelog / todo:
###################

v1.0 (2005-01-09)
+ browser for http://tv4all.com (wmbparser_tv4all.py)
+ browse for all tv stations by country.
+ browser for http://www.radio-locator.com (wmbparser_radiolocator.py)
+ browse for all radio channels by country.
* todo: us channels work differently, need to extend the parser for
selecting separate states.
* todo: browse for all radio channels by genre.
* todo list:
* currently no error checking on getting html objects. probably need
to implement something for that.
* add something to store favorites.
* perhaps spice up the gui a bit.
Reply
#2
nice job !
need some graphical display, but a very good start Wink
go on...
Reply
#3
pretty hard-core architecture you have going on there Smile
it works well though the ui still needs some more design.
i will have to look at it a lot more before i get everything whats going on there.

do you know if it is possible to automatically scan for wmbparser_*.py
files and import the entries you find to avoid having to edit the wmb.py file?

actually it looks like you just need to run the wmbparser_*.py files and they add themselves to the global list... i think you could use xbmc.executescript (or something) for that.

anyway if the file can avoid being modified for each parser than the parser files themselves can be distributed fairly freely from some download page more easily (mixed and matched quickly too). if you could get it to work it might be better to have a 'parsers' folder for these.

im going to really consider using that bsv lib thingie in the future. this is probably the most technical script out there right now too.
Reply
#4
:bowdown: nice work piscator.
i put a news with your web media browser.

on stream-pack site... ; )xbmc-stream :o
Image
all xbox & pc stream on streampack
bdd/xsp streampack : online
Reply
#5
great job.

i just need a tutorial to know how to add other websites.
Reply
#6
Quote:asteron
do you know if it is possible to automatically scan for wmbparser_*.py
files and import the entries you find to avoid having to edit the wmb.py file?  

actually it looks like you just need to run the wmbparser_*.py files and they add themselves to the global list...  i think you could use xbmc.executescript (or something) for that.

anyway if the file can avoid being modified for each parser than the parser files themselves can be distributed fairly freely from some download page more easily (mixed and matched quickly too).   if you could get it to work it might be better to have a 'parsers' folder for these.

good idea, i didn't think of that. actually this is the first time i made something in python, so i'm still a bit struggling where to find the proper functions/classes. i just checked some online docs, and i guess it should be doable by using the function " import ". see python docs

as for putting the parsers in a separate dir, i probably need to mess a bit with sys.path, or the imports cannot be found. i'lll see what i can do.

Quote:asteron
im going to really consider using that bsv lib thingie in the future.  this is probably the most technical script out there right now too.

you mean the bsvxbmcgui thingie? i also plan to add a few more wrapper classes for other gui things as well, e.g. a buttonlist class that makes a bunch of buttons show top-down (like listbox).

@Dash22, thanks for the ad. always good to have free ads for free software :o
Reply
#7
(libonel @ jan. 11 2005,13:36 Wrote:great job.

i just need a tutorial to know how to add other websites.
don't we need all tutorials?  :p

it should be pretty straight-forward, but that's always the case if you know the code. i'll add these developer notes in a next release.

btw, why can't i use underscores in my text, they disappearHuh (% = underscore)

greetz,
piscator



# developer notes:
##################

for version v1.0:
+ take a look at the inline doc in wmbcore.py to see a full description
 of the classes. these are all you need! as to how to parse an html file,
 that's up to you, but i strongly recommend the use of sgmlparser. see
 http://www.diveintopython.org/html_proce...index.html, for examples.
 to get started, you don't need to parse an html file, just play around
 with the wmb data structures and see if you can add something in the
 browser.
+ object rootitem.
 add your own wmbitem objects to rootitem to make them show in the browser.
 for example:
   + tv4all = category(rootitem,"tv4all",default_url)
   + mysite = wmbitem(rootitem","mysite","[url]http://mysite"[/url])
   + mysite = category(rootitem,"mysite","[url]http://mysite"[/url])
+ class wmbitem.
 use the class wmbitem, or subclass it if you want to add more attributes, to
 create browsable items. for example, a country list. important methods are:
   + getdisplayname : determines the display text in the listbox
   + %%repr%%       : allows you to print your object (useful for debugging)
   + addchild       : adds sub-items to your item.
   + initchildren   : if no children exists, this method allows you to
                      initialize all your children.
+ class category, subclass of wmbitem.
 use the class category to add your own categories. the only addition is the
 setparser method, which is used in initchildren. a parser object should have
 the method parse which initializes the children. if you want to do it
 differently, just use wmbitem and override initchildren.
+ class streamparent, subclass of wmbitem.
 use the class streamparent for objects that contain a link to a media url
 (in url attribute). for example, tv channels, radio channels, shoutcast
 channels. the url is automatically parsed in initchildren (necessary for
 asf/asx/ram/rm files as xbmc doesn't accept these, i.e. crash...). note
 that initchildren creates a bunch of stream objects. if you want to do it
 differently, use wmbitem and override initchildren. however, initchildren
 is expected to create a list of stream objects.
+ class stream, subclass of wmbitem.
 use the stream class for objects that are streams. the url of a stream
 object should contain a link to a valid media url. you don't need this if
 you use streamparent.
Reply
#8
hello,
very nice script :kickass: , but i prefer xsp from streampack^^ ..lol
:thumbsup:
++
Reply
#9
i've noticed a problem with it.

i'm using xbmc in hdtv mode. when i run this script the edges of the display cannot be seen.
Reply
#10
guess i'm the only one? i put this in the script folder and ran that wmb.py. it said [running] for a split second then goes away :verysad:
Reply
#11
read the readme file !
Quote:# how to use:
#############

+ install in scripts/webmediabrowser
+ start the webmediabrowser with "wmb.py", not the other scripts!
Reply
#12
(mastiha @ jan. 14 2005,23:22 Wrote:i've noticed a problem with it.

i'm using xbmc in hdtv mode. when i run this script the edges of the display cannot be seen.
that's odd. did you calibrate your screen properly (under settings)? which edge of the screen can't you see and how large is the part you can't see? i'm not sure what is different with hdtv mode compared to a pal/ntsc setup. so i'm afraid i need to get a bit more technical on it, if it is really a problem (since i can't simulate it myself).

internally my scripts use the window.getwidth() and window.getheight() methods (bsvxbmcgui). for pal, they return the values 720 by 480 (i think). what do these do for hdtv?

in wmb.py i create the browser with the following parameters:
Quote:wmbbrowser = bsvxbmcgui.listbox(self.window,20,20,-40,-40)
so for pal, the coords would be (20,20) to (720-40,480-40).
anyway, you can change these parameters yourself to bypass this problem for now.


Quote:russman
guess i'm the only one? i put this in the script folder and ran that wmb.py. it said [running] for a split second then goes away
not wanting to tell the obvious, but you have to install all the files which come in the archive.

greetz,
piscator
Reply
#13
Wink 
hi,

on my box webmedia browser (web media browser) stopped working a couple of xbmc updates ago. (used to work flawlessly)
when i start the script this message won't go away:
'parsing url: http://tv4all.com/television/tvbar.html'
and nothing happens.

thanks for any help!
Reply
#14
website should have change... url can not be found on server.
i think the parsing script has to be re-written
Reply
#15
i'm aware of this. i've been busy rewriting a bit in the parser but didn't have enough time to check it yet. expect an update soon.

greetz,
piscator
Reply

Logout Mark Read Team Forum Stats Members Help
Web Media Browser0