def buildShow(inputParams): url = WEB_PAGE_BASE + inputParams['link'] response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() links = util.extractAll(content, '<div class="col">', '</span>') for link in links: if 'makeCategoriesTV' in inputParams['key']: params = {'key':'makeShows'} else: params = {'key':'makePlay'} util.logAddon('MakePlay') params['title'] = util.extract(link,'data-original-title="','\"') params['link'] = util.extract(link,'href="','\"') params['image'] = util.extract(link,'img src="','"') link = util.makeLink(params) util.addMenuItem(params['title'], link, params['image'], params['image'], True) util.endListing() xbmc.executebuiltin("Container.SetViewMode(500)") else: util.showError(ADDON_ID, 'Could not open URL SHOW %s to create menu' %(url))
if response and response.getcode() == 200: content = response.read() video = util.extract(content, '<a class="channel_link"', '</a>') params = {'play':1} params['video'] = WEB_PAGE_BASE + util.extract(video,'href="','\"') params['image'] = util.extract(video,'img src="','\"') params['title'] = util.extract(video,'channel="','\"') util.logAddon(params) util.endListing() return params else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' %(url)) ''' WEB_PAGE_BASE = 'http://play.fpt.vn' ADDON_ID = 'plugin.video.bit.livetv' parameters = util.parseParameters() if 'play' in parameters: playVideo(parameters) else: buildMenu() util.logAddon('BUILDMENU')
''' def firstRun(): url = WEB_PAGE_BASE + '/livetv' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() video = util.extract(content, '<a class="channel_link"', '</a>') params = {'play':1} params['video'] = WEB_PAGE_BASE + util.extract(video,'href="','\"') params['image'] = util.extract(video,'img src="','\"') params['title'] = util.extract(video,'channel="','\"') util.logAddon(params) util.endListing() return params else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' %(url)) ''' WEB_PAGE_BASE = 'http://play.fpt.vn' ADDON_ID = 'plugin.video.bit.livetv' parameters = util.parseParameters() if 'play' in parameters: playVideo(parameters) else: buildMenu() util.logAddon('BUILDMENU')