def getEpisodeList(self, url): contentType, page = common.getData(url) if url.find('page') == -1: featured = re.compile( '<a class="thumblink" href="(.+?)".*?src="(.+?)".*?alt="(.+?)"' ).findall(page) for url, image, title in featured: title = title.replace('<br/>', ' - ') title = title.replace('|', ' - ') common.addVideoLink(contentType, title, url, self.MODES.PLAY_ITEM, image, __NAME__) items = re.compile( '<div class="entry-content-inside">.*?<a href="(.+?)" title="(.*?)".*?src="(.+?)"' ).findall(page) for url, title, image in items: if url.find('article') == -1: title = title.replace('<br/>', ' - ') title = title.replace('|', ' - ') common.addVideoLink(contentType, title, url, self.MODES.PLAY_ITEM, image, __NAME__) hasNext = re.compile( 'class=\'next page-numbers\' href=\'(.+?)\'').findall(page) if not hasNext == None and len(hasNext) > 0: # there is a next page url = hasNext[0] common.addDir('UTF-8', common.__language__(30001), url, self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__)
def getEpisodes(self, url): params = common.getParams(url) seasonId = str(params["seasonId"]) limit = 100 if params.has_key("page"): page = int(params["page"]) else: page = 1 contentType, pageContent = common.getData( "http://ws.vod.walla.co.il/ws/mobile/android/episodes?id=" + seasonId + "&page=" + str(page) + "&limit=" + str(limit) + "&sort=newest") if common.__DEBUG__ == True: print "WALLA episodes API " print pageContent resultJSON = json.loads(pageContent) episodes = resultJSON["episodes"] # if we have 100 we might have another page - this is assumption there is not total items so we can't check for sure. if len(episodes) == 100: common.addDir('UTF-8', "לדף הבא.....", "page=" + str(page + 1) + "&seasonId=" + seasonId, self.MODES.GET_EPISODES_LIST, elementId=__NAME__) i = 1 for episode in episodes: episodeId = str(episode["id"]) title = "[COLOR yellow]" + str( (page * limit) - limit + i) + ". [/COLOR]" + episode["title"] media = episode["media"] imageTypes = media["types"] image = imageTypes["type_29"] summary = "" if episode.has_key("abstract"): summary = episode["abstract"] elif episode.has_key("about"): summary = episode["about"] iconImage = __IMAGES_BASE__ + image["file"] common.addVideoLink("UTF-8", title, "item_id=" + episodeId, self.MODES.PLAY_MODE, iconImage, elementId=__NAME__, sum=summary) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(500)") i = i + 1
def getGenereItems(self, url): print "walla getSeriesList url:" + str(url) params = common.getParams(url) genreId = params["genreId"] genre = params["genre"] if params.has_key("page"): page = int(params["page"]) else : page = 1 contentType, jsonString = common.getData('http://ws.vod.walla.co.il/ws/mobile/android/genre/'+ genre + "?id=" + genreId + "&page=" + str(page) + "&limit=50&sort=newest") if common.__DEBUG__ == True: print "WALLA genre API " print jsonString resultJSON = json.loads(jsonString) genreItems = resultJSON["events"] totalResults = resultJSON["genre"]["amount"] if totalResults> (50*page): page = page +1 common.addDir('UTF-8', "לדף הבא.....", "page=" + str(page) + "&genre=" + genre + "&genreId=" + genreId, self.MODES.GET_GENRE_ITEMS, elementId=__NAME__) for item in genreItems: itemName = item["title"] if item.has_key("media"): media=item["media"] itemId = str(item["id"]) typeName = item["typeName"] about = item["about"] if item.has_key("duration"): duration = str(item["duration"]) else: duration = '0' if media["types"].has_key("type_29"): iconImage = __IMAGES_BASE__ + media["types"]["type_29"]["file"] else: iconImage = 'DefaultFolder.png' if typeName == "movie": common.addVideoLink("UTF-8",itemName, "item_id="+ itemId ,self.MODES.PLAY_MODE, iconImage,elementId=__NAME__, sum=about,duration=duration) else: common.addDir('UTF-8', itemName, "seriesId=" + itemId , self.MODES.GET_SEASONS_LIST, iconImage, elementId=__NAME__)
def getEpisodes(self, url): params = common.getParams(url) seasonId = str(params["seasonId"]) limit = 100 if params.has_key("page"): page = int(params["page"]) else : page = 1 contentType, pageContent = common.getData("http://ws.vod.walla.co.il/ws/mobile/android/episodes?id=" + seasonId + "&page=" + str(page) + "&limit=" + str(limit) + "&sort=newest") if common.__DEBUG__ == True: print "WALLA episodes API " print pageContent resultJSON = json.loads(pageContent) episodes = resultJSON["episodes"] # if we have 100 we might have another page - this is assumption there is not total items so we can't check for sure. if len(episodes) == 100 : common.addDir('UTF-8', "לדף הבא.....", "page=" + str(page+1) + "&seasonId=" + seasonId , self.MODES.GET_EPISODES_LIST, elementId=__NAME__) i=1 for episode in episodes: episodeId = str(episode["id"]) title = "[COLOR yellow]" + str((page*limit)-limit+i) + ". [/COLOR]" + episode["title"] media = episode["media"] imageTypes = media["types"] image = imageTypes["type_29"] summary = "" if episode.has_key("abstract"): summary = episode["abstract"] elif episode.has_key("about"): summary = episode["about"] iconImage = __IMAGES_BASE__ + image["file"] common.addVideoLink("UTF-8",title, "item_id="+ episodeId ,self.MODES.PLAY_MODE, iconImage,elementId=__NAME__, sum=summary) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(500)") i=i+1
def getEpisodeList(self, url): contentType,page = common.getData(url) if url.find('page') == -1: featured = re.compile('<a class="thumblink" href="(.+?)".*?src="(.+?)".*?alt="(.+?)"').findall(page) for url, image, title in featured: title = title.replace('<br/>', ' - ') title = title.replace('|', ' - ') common.addVideoLink(contentType,title, url, self.MODES.PLAY_ITEM, image, __NAME__) items = re.compile('<div class="entry-content-inside">.*?<a href="(.+?)" title="(.*?)".*?src="(.+?)"').findall(page) for url, title, image in items: if url.find('article') == -1: title = title.replace('<br/>', ' - ') title = title.replace('|', ' - ') common.addVideoLink(contentType,title, url, self.MODES.PLAY_ITEM, image, __NAME__) hasNext = re.compile('class=\'next page-numbers\' href=\'(.+?)\'').findall(page) if not hasNext == None and len(hasNext) > 0: # there is a next page url = hasNext[0] common.addDir('UTF-8',common.__language__(30001), url, self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__)
def getEpisodeList(self, url): contentType,page = common.getData(url) episodes = re.findall('<div class="right navRowItem"><div><a href="(.*?)@vod"><img src="(.*?)".*?vod">(.*?)<.*?vod">(.*?)<', page) for href, img, name, summary in episodes: common.addVideoLink(contentType,name, href, self.MODES.PLAY_VIDEO, img, __NAME__, summary)
def getLive(self, url): contentType,page = common.getData(url) cameras = re.findall('id="camera_div_(\d)" rel="(.*?)"><img src="(.*?)"', page) for camId, cameraName, image in cameras: href = 'rtmp://waflalive.walla.co.il/livestreamcast_edge?tuid=undefined&un=undefined&ait=undefined&wkeys=undefined&divname=undefined&provider=undefined&location=undefined&channel_name=undefined playpath=s_feedvilla' + camId + ' live=true swfUrl=http://i.walla.co.il/w9/swf/video_swf/live/streamcast_nextGen.swf?10 pageUrl=http://dor.walla.co.il/?w=/@live' common.addVideoLink(contentType,cameraName, href, self.MODES.PLAY_VIDEO, image, __NAME__)