def home(): action = {'new': 0, 'page': 1} t = 'أفلام عربية جديدة' title = (t).decode('utf-8') link = util.makeLink(action) util.addMenuItem(title, link, fanart, None, True) action = {'old': 0, 'page': 1} t = 'زمن الفن الجميل ' title = (t).decode('utf-8') link = util.makeLink(action) util.addMenuItem(title, link, fanart, None, True) action = {'spec': 1, 'page': 1} t = 'أفلام عربية للكبار ' title = (t).decode('utf-8') link = util.makeLink(action) util.addMenuItem(title, link, fanart, None, True) action = {'srch': 0} t = 'SEARCH ' title = (t).decode('utf-8') link = util.makeLink(action) util.addMenuItem(title, link, icon, None, True) action = {'hlp': 1} t = 'If you could not Read List: click here:>> ' title = (t).decode('utf-8') link = util.makeLink(action) util.addMenuItem(title, link, icon, None, True) util.endListing()
def buildSubMenu(inputParams): """ Creates the submenu for a category """ ressort = inputParams['ressort'].replace(".", "-") offset = int(inputParams['offset']) fetchsize = int(inputParams['fetchsize']) videoCount = 0 for x in range(0, fetchsize): url = "{0}/multimedia/videos/ressort-{1}/?ot=de.faz.ot.www.teaser.more.mmo&type=VIDEO&offset={2}".format(WEB_PAGE_BASE, ressort, str(offset + x)) log("fetch ressorts: {0}".format(url)) content = fetchFromUrl(url) if content is not None: videoCount = videoCount + parseVideos(content) # add 'next' menu item if more videos available if videoCount > 0: params = {'title':'Next Page', 'ressort':inputParams['ressort'], 'fetchsize':inputParams['fetchsize']} params['offset'] = offset + fetchsize link = util.makeLink(params) util.addMenuItem(params['title'], link) # add 'main menu' item params = {'title':'Main Menu'} link = util.makeLink(params) util.addMenuItem(params['title'], link) util.endListing()
def ololink(params): caption = 'If you have trouble:goto:https://sites.google.com/site/kokiarbic/help' action = {'info': 1} cap_link = util.makeLink(action) util.addMenuItem(caption, cap_link, icon, fanart, False) url = (params['video']) videoPage = requests.get(url) if videoPage and videoPage.status_code == 200: cont = videoPage.text vidlinks = util.extractAll(cont, '"playerst"', '/iframe>') for vidlink in vidlinks: t = 'Movielink' v = util.extract(vidlink, 'SRC="', '"') or util.extract( vidlink, 'src="', '"') paramz = {'play': 1} paramz['title'] = t paramz['videolink'] = v paramz['image'] = params['image'] link = util.makeLink(paramz) util.addMenuItem(paramz['title'], link, 'DefaultVideo.png', paramz['image'], False) else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url)) util.endListing()
def menuLink(params): caption = 'try HD first: #1--OK.ru ,#2--openload(try it several clicks until work) ' action = {'info': 1} cap_link = util.makeLink(action) util.addMenuItem(caption, cap_link, icon, fanart, False) url = (params['video']) videoPage = requests.get(url) if videoPage and videoPage.status_code == 200: cont = videoPage.text vidlinks = util.extractAll(cont, '<div id="tab', '/div>') for vidlink in vidlinks: t = util.extract(vidlink, '://', '/') v = util.extract(vidlink, 'SRC="', '"') or util.extract( vidlink, 'src="', '"') paramz = {'play': 1} paramz['title'] = t paramz['videolink'] = v paramz['image'] = params['image'] link = util.makeLink(paramz) util.addMenuItem(paramz['title'], link, 'DefaultVideo.png', paramz['image'], False) else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url)) util.endListing()
def pages(params): page = int(params['page']) p = 'page:' + str(page) util.addMenuItem(p, None, None, None, False) Baseurl = 'http://el7l.tv/online2/12/_%D8%A7%D9%81%D9%84%D8%A7%D9%85_%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9/' url = Baseurl + '%d.html' % (page) response = requests.get(url) if response and response.status_code == 200: cont = response.text videos = util.extractAll(cont, '<div class="file_index">', '/div>') for video in videos: t = util.extract(video, 'alt="', '"') v = util.extract(video, 'a href="http://el7l.tv/online', '"') vp = 'http://el7l.tv/play' + v i = util.extract(video, 'img src="', '"') params = {'listing': 1} params['title'] = t params['video'] = vp params['image'] = i link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], True) else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url)) parms = {'old': 1, 'page': str(page + 1)} page_link = util.makeLink(parms) util.addMenuItem('Next Page:>> ', page_link, None, None, True) util.endListing()
def buildMenu(): for channel in sorted(channels.keys()): params = {'play': 1} params['channel'] = channel link = util.makeLink(params) util.addMenuItem(channel, link, 'DefaultVideo.png', 'DefaultVideo.png') util.endListing()
def search(): dialog = xbmcgui.Dialog() i = dialog.input('Enter Movie Name:', type=xbmcgui.INPUT_ALPHANUM) q = urllib.quote(i, safe="%/:=&?~#+!$,;'@()*[]") baseurl = 'https://www.google.com.sa/search?rlz=1C1CHZL_enSA679SA679&espv=2&q=el7al.tv+' print q url = baseurl + q + '&oq=el7al.tv+' + q + '&gs_l=serp.3...33231.51533.0.52317.42.30.8.0.0.0.211.4360.0j21j4.25.0....0...1c.1.64.serp..11.22.2813.0..0j30i10k1j0i13k1j0i13i30k1j0i7i30k1j35i39k1j0i131k1j0i10i30k1j0i13i10k1.w4AW4pCV-E4' response = requests.get(url) if response and response.status_code == 200: cont = response.text videos = util.extractAll(cont, '<a href="/url?q=http://el7l.tv/online', 'class="_cD"') for video in videos: t = util.extract(video, '>', '</a>') t1 = (t.replace('\n', '').replace('\t', '').replace('</b>', '').replace('<b>', '').lstrip()) u1 = (util.extract(video, '/', '&')) u = 'http://el7l.tv/play/' + u1 params = {'search': 1} params['url'] = u params['title'] = t1 link = util.makeLink(params) util.addMenuItem(params['title'], link, None, None, True) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def buildMenu(): url = "http://nottstv.com/programmes/" response = urllib2.urlopen(url) path = addon.getAddonInfo('path') if response and response.getcode() == 200: content = response.read() params = {'programme': 1} params['label'] = "Notts TV News Reports" params['tag'] = "news" link = util.makeLink(params) util.addMenuItem(params['label'], link, 'news.png', path + '/images/news.png', True) programmes = util.extractAll(content, 'http://nottstv.com/programmes/', '</a>') for programmelist in programmes: if "jQuery" in programmelist: continue programme = programmelist.split('">') if programme[1] == "Programmes": continue params = {'programme': 1} params['label'] = programme[1] params['tag'] = programme[0] link = util.makeLink(params) thumb = 'DefaultVideo.png' if programme[1] == 'Nottingham Now and Then': thumb = path + '/images/nowandthen.png' if programme[1] == 'Mass Bolero': thumb = path + '/images/massbolero.png' if programme[1] == 'The 6:30 Show': thumb = path + '/images/630show.png' if programme[1] == 'Channel 8 Debate': thumb = path + '/images/8debate.png' if programme[1] == 'Day in the Life': thumb = path + '/images/dayinthelife.png' if programme[1] == 'Inside Industry Week': thumb = path + '/images/insideindustry.jpg' if programme[1] == 'Noise Floor': thumb = path + '/images/noisefloor.png' if programme[1] == 'The Boot Room': thumb = path + '/images/bootroom.png' if programme[1] == 'The Locker Room': thumb = path + '/images/lockerroom.png' if programme[1] == 'Working Week': thumb = path + '/images/workingweek.png' print path util.addMenuItem(params['label'], link, thumb, thumb, True) util.addCategory('>> Current Affairs', 'current-affairs') util.addCategory('>> Entertainment', 'entertainment') util.addCategory('>> Lifestyle', 'lifestyle') util.addCategory('>> Sport', 'sport', path + '/images/sport.jpg') util.addCategory('>> Music', 'music') util.addCategory('>> Specials', 'specials') util.endListing() else: util.showError('plugin.video.nottstv', 'Could not open URL %s to create menu' % (url)) pass
def parseRessorts(content): """ Parses the html content for categories """ for x in re.findall(r"<a.*fazAjaxContentChanger.*ressort=(\d\.\d*).*>(.*)</a>", content): params = {} params['title'] = x[1] params['ressort'] = x[0] params['offset'] = 0 params['fetchsize'] = 3 link = util.makeLink(params) util.addMenuItem(params['title'], link) util.endListing()
def showArqivaMenu(): util.addArqiva("CCTV News", "http://stream.arqiva.tv/cctv-news", 'thumbs/cctv_news.png') util.addArqiva("CCTV-4", "http://stream.arqiva.tv/cctv-4", '/thumbs/cctv-4.png') util.addArqiva("CCTV-9 Documentary", "http://stream.arqiva.tv/cctv-9", '/thumbs/cctv-9.png') util.addArqiva("Chatbox", "http://stream.arqiva.tv/chatbox", '/thumbs/chat_box.png') util.addArqiva("Gay Network", "http://stream.arqiva.tv/gaynet", '/thumbs/gay_network.png') util.addArqiva("Motors TV", "http://stream.arqiva.tv/motorstv", '/thumbs/motors_tv_uk.png') util.addArqiva("QVC Beauty", "http://stream.arqiva.tv/qvc-beau", '/thumbs/qvc_beauty.png') util.addArqiva("QVC Extra", "http://stream.arqiva.tv/qvc-extra", '/thumbs/qvc_extra.png') util.addArqiva("QVC Plus", "http://stream.arqiva.tv/qvc-plus", '/thumbs/qvc.png') util.addArqiva("QVC Style", "http://stream.arqiva.tv/qvc-style", '/thumbs/qvc_style.png') util.addArqiva("Racing UK (Preview)", "http://stream.arqiva.tv/racinguk", '/thumbs/racing_uk.png') util.addArqiva("RT Doc", "http://stream.arqiva.tv/rt-doc", '/thumbs/rtd.png') util.addArqiva("SBN TV (Sonlife)", "http://stream.arqiva.tv/sbntvuk", '/thumbs/sonlife.png') util.addArqiva("Vintage TV", 'http://stream.arqiva.tv/vintagetv', '/thumbs/vintage_tv.png') util.addArqiva("JSTV 1 (Promo)", 'http://stream.arqiva.tv/vod/JSTV-1/jstv_promo_01.ts', '/thumbs/jstv1.png') util.addArqiva("JSTV 2 (Promo)", 'http://stream.arqiva.tv/vod/JSTV-2/jstv_promo_01.ts', '/thumbs/jstv2.png') util.addArqiva( "kykNET (Promo)", 'http://stream.arqiva.tv/vod/KYKNET-MAIN/kykmain_promo_01.ts', '/thumbs/kyknet.png') util.addArqiva( "kykNET Musiek (Promo)", 'http://stream.arqiva.tv/vod/KYKNET-MUZ/kykmuz_promo_01.ts', '/thumbs/kyknetmusiek.png') util.addArqiva("abn", 'http://stream.arqiva.tv/abntv', '/thumbs/abn.png') util.addArqiva("Passion", 'http://stream.arqiva.tv/passion', '/thumbs/passion.png') util.addArqiva("Showcase", 'http://stream.arqiva.tv/showcase', '/thumbs/showcase.png') util.endListing() pass
def buildSubMenu(params): response = urllib2.urlopen(params['video']) if response and response.getcode() == 200: content = response.read() videos = util.extractAll(content, '<td width="40%" align="center">', '/td>') for video in videos: params = {'play':1} params['video'] = WEB_PAGE_BASE + util.extract(video, 'a href="', '\"') params['image'] = WEB_PAGE_BASE + util.extract(video, 'img src="', '\"') params['title'] = util.extract(video, '<p align="center">', '</p>') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], False) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def showMainMenu(): params = {'livetv': 1, 'foo': 'bar'} link = util.makeLink(params) util.addMenuItem('Live TV', link, 'DefaultVideo.png', 'DefaultVideo.png', True) params = {'arqivamenu': 1} link = util.makeLink(params) util.addMenuItem('Arqiva Connect', link, 'DefaultVideo.png', 'DefaultVideo.png', True) params = {'recordings': 'no'} link = util.makeLink(params) util.addMenuItem('Recordings', link, 'DefaultVideo.png', 'DefaultVideo.png', True) util.endListing() pass
def buildMenu(): url = WEB_PAGE_BASE + '/livetv' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() videos = util.extractAll(content, '<a class="channel_link"', '</a>') for video in videos: 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="','\"') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], False) xbmc.executebuiltin("Container.SetViewMode(52)") util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' %(url))
def buildMenu(): url = WEB_PAGE_BASE response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() videos = util.extractAll(content, '<video duration', '</video>') for video in videos: params = {'play': 1} params['video'] = util.extract(video, 'video_id="', '"') params['image'] = util.extract(video, 'default_thumb="', '"') params['title'] = util.extract(video, '<title><![CDATA[', ']]') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], False) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def buildPlay(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: params = {'makePlay':1} 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(506)") else: util.showError(ADDON_ID, 'Could not open URL SHOW %s to create menu' %(url))
def buildMenu(): url = WEB_PAGE_BASE response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() params = {} videos = util.extractInfo(content, STARTSTRING, ENDSTRING) for video in videos: linkTitle = util.makeTitle(video) params = {'play':1} params['video'] = 'http://www.tvkstella.pl/play.php?id=%s' % video params['image'] = 'http://www.tvkstella.pl/img/nowe/%s.jpg' % video params['title'] = linkTitle link = util.makeLink(params) util.addMenuItem(linkTitle, link, 'DefaultVideo.png', params['image'], False) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def buildCategories(): url = WEB_PAGE_BASE + '/the-loai/music' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() links = util.extractAll(content, 'idscroll="', '<ul class="thumn">') for link in links: params = {'makeCategories':1} params['link'] = util.extract(link,'href="','\"') params['title'] = util.extract(link,'/1">','</a>') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', 'DefaultVideo.png', True) util.endListing() xbmc.executebuiltin("Container.SetViewMode(506)") else: util.showError(ADDON_ID, 'Could not open URL CATEGORIES %s to create menu' %(url))
def buildMenu(): url = 'http://play.fpt.vn/' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() makeLinks = util.extract(content, '"nav navbar-nav menu"', '</ul>') links = util.extractAll(makeLinks,'<li >','a>') for link in links: params = {'key':'makeMenu'} params['link'] = util.extract(link,'href="','\"') params['title'] = util.extract(link,'\">','</') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', 'DefaultVideo.png', True) util.endListing() xbmc.executebuiltin("Container.SetViewMode(500)") else: util.showError(ADDON_ID, 'Could not open URL CATEGORIES %s to create menu' %(url))
def buildMenu(): url = WEB_PAGE_BASE + 'tv_rec.php' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() videos = util.extractAll(content, '<td class="td_ser">', '</td>') for video in videos: params = {'play': 1} params['video'] = WEB_PAGE_BASE + util.extract( video, '<a href="', '"') params['image'] = "" params['title'] = util.extract( video, 'title="', '"').decode('windows-1251').encode('utf-8') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], False) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def buildMenu(): url = WEB_PAGE_BASE + '/livetv' response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() videos = util.extractAll(content, '<a class="channel_link"', '</a>') for video in videos: 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="', '\"') link = util.makeLink(params) util.addMenuItem(params['title'], link, 'DefaultVideo.png', params['image'], False) xbmc.executebuiltin("Container.SetViewMode(52)") util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def buildPlay(inputParams): url = WEB_PAGE_BASE + inputParams['link'] response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() links = util.extract(content, 'a href="#">«', 'href="#">»') extractLinks = util.extractAll(links,'a href="','"') for link in extractLinks: params = {'key':'makePlaymakePlay'} params['title'] = util.extractTitle(link) params['link'] = link params['image'] = inputParams['image'] link = util.makeLink(params) util.addMenuItem(params['title'], link, params['image'], params['image'], False) util.endListing() xbmc.executebuiltin("Container.SetViewMode(500)") else: util.showError(ADDON_ID, 'Could not open URL PLAY %s to create menu' %(url))
def searchp(params): url = (params['url']) videoPage = requests.get(url) if videoPage and videoPage.status_code == 200: cont = videoPage.text vidlinks = util.extractAll(cont, '<div id="tab', '/div>') for vidlink in vidlinks: t = util.extract(vidlink, '://', '/') v = util.extract(vidlink, 'SRC="', '"') or util.extract( vidlink, 'src="', '"') paramz = {'play': 1} paramz['title'] = t paramz['videolink'] = v paramz['image'] = icon link = util.makeLink(paramz) util.addMenuItem(paramz['title'], link, paramz['image'], None, False) util.endListing() else: util.showError(ADDON_ID, 'Could not open URL %s to create menu' % (url))
def getTaggedEpisodes(tag): if tag == "now%20and%20then": url = "http://api.brightcove.com/services/library?command=search_videos&token=1N4JCL3KisuyvNlDIPdrJGpatQ1dVXuaCRtD88vFyCqx6Va1G_yGtg..&video_fields=id,name,videoStillURL,tags&sort_by=start_date:desc&any=custom_fields:" + tag elif tag == "channel%208%20debate": url = "http://api.brightcove.com/services/library?command=search_videos&token=1N4JCL3KisuyvNlDIPdrJGpatQ1dVXuaCRtD88vFyCqx6Va1G_yGtg..&video_fields=id,name,videoStillURL,tags&sort_by=start_date:desc&any=custom_fields:" + tag else: url = "http://api.brightcove.com/services/library?command=search_videos&token=1N4JCL3KisuyvNlDIPdrJGpatQ1dVXuaCRtD88vFyCqx6Va1G_yGtg..&video_fields=id,name,videoStillURL,tags&sort_by=start_date:desc&all=tag:" + tag response = urllib2.urlopen(url) if response and response.getcode() == 200: content = response.read() episodes = json.loads(content) for episode in episodes['items']: params = {'episode': 1} params['label'] = episode['name'] params['id'] = episode['id'] params['thumb'] = episode['videoStillURL'] thumb = episode['videoStillURL'] link = util.makeLink(params) util.addMenuItem(params['label'], link, thumb, thumb, False) util.endListing() else: util.showError('plugin.video.nottstv', 'Could not open URL %s to create menu' % (url)) pass
def showLiveTV(): ipaddress = addon.getSetting("ipaddress") if ipaddress == '': xbmc.executebuiltin( 'XBMC.Notification(Info:,"IP Address Not Set",3000,' + addon.getAddonInfo('icon') + ')') else: playlist = "http://" + ipaddress + "/Live/Channels/getList?tvOnly=0&avoidHD=0&allowHidden=0&fields=name,id,zap,isDVB,hidden,rank,isHD,logo" response = urllib2.urlopen(playlist) if response and response.getcode() == 200: channels = json.loads(response.read()) for channel in channels: if channel['hidden'] == False and (channel['zap'] < 225 or channel['zap'] > 300): params = {'playlivetv': 1} params['label'] = str( channel['zap']) + ' ' + channel['name'] params[ 'url'] = "http://" + ipaddress + "/Live/Channels/get?channelId=" + channel[ 'id'] params['id'] = channel['id'] if channel.has_key('logo') == True: params['thumb'] = channel['logo'] else: params[ 'thumb'] = "http://" + ipaddress + "/Live/Channels/getLogo?zap=" + str( channel['zap']) params['zap'] = channel['zap'] thumb = params['thumb'] util.addMenuItem(params['label'], util.makeLink(params), thumb, thumb, False) util.endListing() else: util.notify('plugin.video.eetv', 'Could not open URL %s to create menu' % (url)) pass
import util, simplelauncher ADDON_ID = 'emulator.tools.retroarch' addon = xbmcaddon.Addon(id=ADDON_ID) addon_dir = xbmc.translatePath(addon.getAddonInfo('path')) addonfolder = addon.getAddonInfo('path') icon = addonfolder + '/icon.png' fanart = addonfolder + '/fanart.jpg' if util.getConfig("simple_launcher_enabled") == "true": # Parse parameters parameters = util.parseParameters() if 'm' in parameters: simplelauncher.launchMenu(parameters) elif 'r' in parameters: simplelauncher.playGame(parameters) elif 'f' in parameters: simplelauncher.listGames(parameters, fanart, addon.getLocalizedString(30005)) else: simplelauncher.buildMenu(fanart, addon.getLocalizedString(30004)) # Ends list of items for xbmc util.endListing() else: util.runRetroarchMenu()
def showRecordings(show_series): ipaddress = addon.getSetting("ipaddress") if ipaddress == '': xbmc.executebuiltin( 'XBMC.Notification(Info:,"IP Address Not Set",3000,' + addon.getAddonInfo('icon') + ')') else: recordings = "http://" + ipaddress + "/PVR/Records/getList?type=regular&avoidHD=0&tvOnly=0" try: response = urllib2.urlopen(recordings) if response and response.getcode() == 200: path = addon.getAddonInfo('path') recordings = json.loads(response.read()) recordings_array = [] known_series = {} # Need to sort by event.name for rec in recordings: if rec['event'].has_key('serieId'): series_id = rec['event']['serieId'] else: series_id = "n/a" if series_id == show_series or (series_id == 'n/a' and show_series == 'no'): # Showing the series I wish to show, or the episode was not in a series, therefore we want to show the episode params = {'playrecording': 1} params['id'] = rec['id'] if rec['event'].has_key('icon'): params['icon'] = rec['event']['icon'] else: params['icon'] = "DefaultVideo.png" if rec['event'].has_key('description'): params['plot'] = rec['event']['description'] else: params['plot'] = "" params['label'] = rec['event']['name'] start = datetime.datetime.fromtimestamp( rec['event']['startTime']) start = start.strftime("%d/%m/%Y %H:%M") params['label'] = params['label'] + " : " + start start = datetime.datetime.fromtimestamp( rec['event']['startTime']) start = start.strftime("%Y-%m-%d %H:%M") params['sort_label'] = params['label'] + " : " + start recordings_array.append(params) elif known_series.has_key( series_id) == False and show_series == 'no': # Showing a placeholder to the series menu params = {'recordings': series_id} params['id'] = rec['id'] if rec['event'].has_key('icon'): params['icon'] = rec['event']['icon'] else: params['icon'] = "DefaultVideo.png" if rec['event'].has_key('description'): params['plot'] = rec['event']['description'] else: params['plot'] = "" params['label'] = rec['event']['name'] + " >> " params['sort_label'] = params['label'] recordings_array.append(params) known_series[series_id] = True recordings_array.sort(key=lambda x: x['sort_label'], reverse=False) for rec in recordings_array: print rec['label'] + " : " + rec['sort_label'] if rec.has_key('recordings'): isFolder = True else: isFolder = False util.addMenuItem(rec['label'], util.makeLink(rec), rec['icon'], rec['icon'], isFolder, rec['plot']) util.endListing() else: xbmc.executebuiltin( 'XBMC.Notification(Info:,"Is the EE Box Turned On?",3000,' + addon.getAddonInfo('icon') + ')') except urllib2.HTTPError as e: reply = e.read() if reply.find('Error 503'): dialog = xbmcgui.Dialog() turnon = dialog.yesno( "Turn EE TV Box On?", "It looks like your EE TV Box is in standby.", "Would you like to press the on/off button?", "", "No", "Yes") if turnon: power_on = "http://" + ipaddress + "/RemoteControl/KeyHandling/sendKey?avoidLongPress=1&key=on_off" try: urllib2.urlopen(power_on) xbmc.executebuiltin( 'XBMC.Notification(Info:,"Your EE TV Box should be waking up, please wait a few seconds and try again.",10000,' + addon.getAddonInfo('icon') + ')') except urllib2.HTTPError as e: reply = e.read() xbmc.executebuiltin( 'XBMC.Notification(Info:,"Error : ' + reply + '",10000,' + addon.getAddonInfo('icon') + ')') else: xbmc.executebuiltin('XBMC.Notification(Info:,"Error : ' + reply + '",10000,' + addon.getAddonInfo('icon') + ')') #xbmc.executebuiltin('XBMC.Notification(Info:,"HTTP ERROR Is the EE Box Turned On?",3000,'+addon.getAddonInfo('icon')+')') pass