home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
TVgemist 3.0
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Marky909" data-source="post: 530246" data-attributes="member: 99280"><p>It's not just a single stream. It's more like online video's. You can watch episoded of different cartoons. I don't know if this help, but here's the python channel script of the XOT plugin:</p><p></p><p>#===============================================================================</p><p># Import the default modules</p><p>#===============================================================================</p><p>import xbmc, xbmcgui</p><p>import re, sys, os</p><p>import urlparse</p><p>#===============================================================================</p><p># Make global object available</p><p>#===============================================================================</p><p>import common</p><p>import mediaitem</p><p>import config</p><p>import controls</p><p>import contextmenu</p><p>import chn_class</p><p></p><p>logFile = sys.modules['__main__'].globalLogFile</p><p>uriHandler = sys.modules['__main__'].globalUriHandler</p><p></p><p>#===============================================================================</p><p># register the channels</p><p>#===============================================================================</p><p>if (sys.modules.has_key('progwindow')):</p><p> register = sys.modules['progwindow']</p><p>elif (sys.modules.has_key('plugin')):</p><p> register = sys.modules['plugin']</p><p>#register.channelButtonRegister.append(108)</p><p></p><p>register.channelRegister.append('chn_nickelodeon.Channel("uzg-channelwindow.xml", config.rootDir, config.skinFolder, channelCode="nickelodeon")')</p><p></p><p>#===============================================================================</p><p># main Channel Class</p><p>#===============================================================================</p><p>class Channel(chn_class.Channel):</p><p> """</p><p> main class from which all channels inherit</p><p> """</p><p> </p><p> #===============================================================================</p><p> def InitialiseVariables(self):</p><p> """</p><p> Used for the initialisation of user defined parameters. All should be </p><p> present, but can be adjusted</p><p> """</p><p> # call base function first to ensure all variables are there</p><p> chn_class.Channel.InitialiseVariables(self)</p><p> self.guid = "8D4EBAE8-F3C6-11DD-92EE-F2FE55D89593"</p><p> self.icon = "nickelodeonicon.png"</p><p> self.iconLarge = "nickelodeonlarge.png"</p><p> self.noImage = "nickelodeonimage.png"</p><p> self.channelName = "Nickelodeon TurboNick"</p><p> self.maxXotVersion = "3.2.0"</p><p> self.channelDescription = "TurboNick afleveringen van Nickelodeon"</p><p> self.moduleName = "chn_nickelodeon.py"</p><p> self.mainListUri = "http://www.nickelodeon.nl/turbonick"</p><p> self.baseUrl = "http://www.nickelodeon.nl"</p><p> self.onUpDownUpdateEnabled = True</p><p> self.sortOrder = 11</p><p> </p><p> self.contextMenuItems = []</p><p> self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using Mplayer", "CtMnPlayMplayer", itemTypes="video", completeStatus=True))</p><p> self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using DVDPlayer", "CtMnPlayDVDPlayer", itemTypes="video", completeStatus=True))</p><p> </p><p> self.requiresLogon = False</p><p> </p><p> self.episodeItemRegex = '<span[^>]+class="list_title"[^>]+>\W+<a[^>]+href="(/turbonick/programma/[^"]+)" title="([^"]+)">' # used for the ParseMainList</p><p> self.videoItemRegex = '<a[^>]+href="(/turbonick/bekijk/[^"]+)"[^>+]title="([^"]+)">\W+<img[^>]+src="([^"]+)"[^>]+/>\W+</a>' # used for the CreateVideoItem </p><p># self.folderItemRegex = '<a href="\.([^"]*/)(cat/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br' # used for the CreateFolderItem</p><p> self.mediaUrlRegex = '<param name="src" value="([^"]+)" />' # used for the UpdateVideoItem</p><p> return True</p><p> </p><p> #==============================================================================</p><p> # ContextMenu functions</p><p> #==============================================================================</p><p> def CtMnPlayMplayer(self, selectedIndex):</p><p> item = self.listItems[selectedIndex]</p><p> self.PlayVideoItem(item, "mplayer")</p><p> </p><p> def CtMnPlayDVDPlayer(self, selectedIndex):</p><p> item = self.listItems[selectedIndex]</p><p> self.PlayVideoItem(item,"dvdplayer") </p><p> </p><p> #==============================================================================</p><p> def CreateEpisodeItem(self, resultSet):</p><p> """</p><p> Accepts an arraylist of results. It returns an item. </p><p> """</p><p> logFile.debug('starting CreateEpisodeItem for %s', self.channelName)</p><p> </p><p> item = mediaitem.MediaItem(resultSet[1], "%s%s" % (self.baseUrl, resultSet[0]))</p><p> item.icon = self.icon</p><p> item.complete = True</p><p> return item</p><p> </p><p> #============================================================================= </p><p> def CreateVideoItem(self, resultSet):</p><p> """</p><p> Accepts an arraylist of results. It returns an item. </p><p> """</p><p> logFile.debug('starting CreateVideoItem for %s', self.channelName)</p><p> </p><p> item = mediaitem.MediaItem(resultSet[1], "%s%s" % (self.baseUrl, resultSet[0]))</p><p> </p><p> item.thumbUrl = resultSet[2]</p><p> item.icon = self.icon</p><p> item.type = 'video'</p><p> item.complete = False</p><p> return item</p><p> </p><p> #============================================================================= </p><p> def UpdateVideoItem(self, item):</p><p> """</p><p> Accepts an item. It returns an updated item. Usually retrieves the MediaURL </p><p> and the Thumb! It should return a completed item. </p><p> """</p><p> logFile.info('starting UpdateVideoItem for %s (%s)', item.name, self.channelName)</p><p> </p><p> if item.thumbUrl != "":</p><p> item.thumb = self.CacheThumb(item.thumbUrl)</p><p> else:</p><p> item.thumb = self.noImage</p><p> </p><p> data = uriHandler.Open(item.url, pb=False)</p><p> </p><p> info = common.DoRegexFindAll("var voteUrl = '/scripts/global/vote.php\?type=video&id=(\d+)';\W+var voteAvg\W*(\d+)", data)</p><p> if len(info) < 1:</p><p> logFile.error("Cannot find info and ID information")</p><p> return item</p><p> else:</p><p> info = info[0]</p><p> </p><p> # get the rank</p><p> item.rating = int(info[1])</p><p> </p><p> # get the RTMP url </p><p> rtmpInfoUrl = "%s/feeds/turbonick/mediaGen.php?id=%s" % (self.baseUrl, info[0])</p><p> rtmpData = uriHandler.Open(rtmpInfoUrl, pb=False)</p><p> rtmpUrls = common.DoRegexFindAll("<src>(rtmp[^<]+)</src>" ,rtmpData)</p><p> </p><p> for rtmpUrl in rtmpUrls:</p><p> item.AppendMediaListItem(rtmpUrl)</p><p> </p><p> item.complete = True</p><p> logFile.debug("Media url: %s", item)</p><p> return item</p></blockquote><p></p>
[QUOTE="Marky909, post: 530246, member: 99280"] It's not just a single stream. It's more like online video's. You can watch episoded of different cartoons. I don't know if this help, but here's the python channel script of the XOT plugin: #=============================================================================== # Import the default modules #=============================================================================== import xbmc, xbmcgui import re, sys, os import urlparse #=============================================================================== # Make global object available #=============================================================================== import common import mediaitem import config import controls import contextmenu import chn_class logFile = sys.modules['__main__'].globalLogFile uriHandler = sys.modules['__main__'].globalUriHandler #=============================================================================== # register the channels #=============================================================================== if (sys.modules.has_key('progwindow')): register = sys.modules['progwindow'] elif (sys.modules.has_key('plugin')): register = sys.modules['plugin'] #register.channelButtonRegister.append(108) register.channelRegister.append('chn_nickelodeon.Channel("uzg-channelwindow.xml", config.rootDir, config.skinFolder, channelCode="nickelodeon")') #=============================================================================== # main Channel Class #=============================================================================== class Channel(chn_class.Channel): """ main class from which all channels inherit """ #=============================================================================== def InitialiseVariables(self): """ Used for the initialisation of user defined parameters. All should be present, but can be adjusted """ # call base function first to ensure all variables are there chn_class.Channel.InitialiseVariables(self) self.guid = "8D4EBAE8-F3C6-11DD-92EE-F2FE55D89593" self.icon = "nickelodeonicon.png" self.iconLarge = "nickelodeonlarge.png" self.noImage = "nickelodeonimage.png" self.channelName = "Nickelodeon TurboNick" self.maxXotVersion = "3.2.0" self.channelDescription = "TurboNick afleveringen van Nickelodeon" self.moduleName = "chn_nickelodeon.py" self.mainListUri = "http://www.nickelodeon.nl/turbonick" self.baseUrl = "http://www.nickelodeon.nl" self.onUpDownUpdateEnabled = True self.sortOrder = 11 self.contextMenuItems = [] self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using Mplayer", "CtMnPlayMplayer", itemTypes="video", completeStatus=True)) self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using DVDPlayer", "CtMnPlayDVDPlayer", itemTypes="video", completeStatus=True)) self.requiresLogon = False self.episodeItemRegex = '<span[^>]+class="list_title"[^>]+>\W+<a[^>]+href="(/turbonick/programma/[^"]+)" title="([^"]+)">' # used for the ParseMainList self.videoItemRegex = '<a[^>]+href="(/turbonick/bekijk/[^"]+)"[^>+]title="([^"]+)">\W+<img[^>]+src="([^"]+)"[^>]+/>\W+</a>' # used for the CreateVideoItem # self.folderItemRegex = '<a href="\.([^"]*/)(cat/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br' # used for the CreateFolderItem self.mediaUrlRegex = '<param name="src" value="([^"]+)" />' # used for the UpdateVideoItem return True #============================================================================== # ContextMenu functions #============================================================================== def CtMnPlayMplayer(self, selectedIndex): item = self.listItems[selectedIndex] self.PlayVideoItem(item, "mplayer") def CtMnPlayDVDPlayer(self, selectedIndex): item = self.listItems[selectedIndex] self.PlayVideoItem(item,"dvdplayer") #============================================================================== def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s', self.channelName) item = mediaitem.MediaItem(resultSet[1], "%s%s" % (self.baseUrl, resultSet[0])) item.icon = self.icon item.complete = True return item #============================================================================= def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) item = mediaitem.MediaItem(resultSet[1], "%s%s" % (self.baseUrl, resultSet[0])) item.thumbUrl = resultSet[2] item.icon = self.icon item.type = 'video' item.complete = False return item #============================================================================= def UpdateVideoItem(self, item): """ Accepts an item. It returns an updated item. Usually retrieves the MediaURL and the Thumb! It should return a completed item. """ logFile.info('starting UpdateVideoItem for %s (%s)', item.name, self.channelName) if item.thumbUrl != "": item.thumb = self.CacheThumb(item.thumbUrl) else: item.thumb = self.noImage data = uriHandler.Open(item.url, pb=False) info = common.DoRegexFindAll("var voteUrl = '/scripts/global/vote.php\?type=video&id=(\d+)';\W+var voteAvg\W*(\d+)", data) if len(info) < 1: logFile.error("Cannot find info and ID information") return item else: info = info[0] # get the rank item.rating = int(info[1]) # get the RTMP url rtmpInfoUrl = "%s/feeds/turbonick/mediaGen.php?id=%s" % (self.baseUrl, info[0]) rtmpData = uriHandler.Open(rtmpInfoUrl, pb=False) rtmpUrls = common.DoRegexFindAll("<src>(rtmp[^<]+)</src>" ,rtmpData) for rtmpUrl in rtmpUrls: item.AppendMediaListItem(rtmpUrl) item.complete = True logFile.debug("Media url: %s", item) return item [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
TVgemist 3.0
Contact us
RSS
Top
Bottom