2010-10-25, 11:24
When I wrote the script, I used names from NRK's "API", but it is confusing even for me now. All the playlist stuff should be ignored and even totaly removed.
get_live_shows: this was used before NRK offered their channels for live streaming. Ignore it
get_shows_by_theme: all productions in a specified category
get_all_shows: all productions listed with the bokstav/@
extract.catalog() should return a MediaObj-class. It's used like a dict, and stores the title, thumbnail and other information "extracted" from the data you passed. It's also should contain a key-class who handles the parameters for setting the state to the plugin.
To read parameters:
It's also important how you receive the documents. I prefer to pass the silverlight enabled in a cookie passed with the header. You will also need to pass a bitrate for the connnection, else you will be redirected to a setup-document
http://www.nrk.no/nett-tv/menyfragment.a...ry&id=8500
above url is some of the old ajax-api they used that still remains, and you will need this to fetch info of the tree structure for a productions
I like to use regex myself as I find it faster and with less code. The regex in the plugin are pretty straight forward, and looks for a flexible patterni the document, but since the regex used was wrote for the old nett-tv I won't try breaking them up and explain them.
Edit: If you want more detailed information about something, I would prefer IM in norwegian
get_live_shows: this was used before NRK offered their channels for live streaming. Ignore it
get_shows_by_theme: all productions in a specified category
get_all_shows: all productions listed with the bokstav/@
extract.catalog() should return a MediaObj-class. It's used like a dict, and stores the title, thumbnail and other information "extracted" from the data you passed. It's also should contain a key-class who handles the parameters for setting the state to the plugin.
Code:
from utils import Key
myObj = MediaObj(title='Xbmc television series', thumbnail='http://xbmc.org/image.png')
myObj.key = Key(type='programs', id='programid')
#Above will produce a command line like myPath/myScript.py?__prefix__&&title='Xbmc television series'&thumbnail='http://xbmc.org/image.png' and url encode it
#standard notation used for integers arrays, strings and so on
To read parameters:
Code:
key = Key( sys.argv[2] )
print key.id
# >>> programid
It's also important how you receive the documents. I prefer to pass the silverlight enabled in a cookie passed with the header. You will also need to pass a bitrate for the connnection, else you will be redirected to a setup-document
http://www.nrk.no/nett-tv/menyfragment.a...ry&id=8500
above url is some of the old ajax-api they used that still remains, and you will need this to fetch info of the tree structure for a productions
I like to use regex myself as I find it faster and with less code. The regex in the plugin are pretty straight forward, and looks for a flexible patterni the document, but since the regex used was wrote for the old nett-tv I won't try breaking them up and explain them.
Edit: If you want more detailed information about something, I would prefer IM in norwegian