def getSeriesList(self): ## get all the series base url contentType, urls = common.getMatches( __BASE_URL__, '<a class="block w3 fldevt goldsep red bold" href="(.+?)" onclick="Evt\(this,(\d),"(.+?)",3,"folder_new_prakim_melaim' ) ## for each series we get the series page to parse all the info from for path, num, title in urls: ## num is not used and does nothing. if path.startswith("http://"): contentType, page = common.getData(path) url = path else: contentType, page = common.getData(__BASE_URL__ + path) url = __BASE_URL__ + path sumMatch = re.compile('class="w3">(.*?)<').findall(page) iconImage = re.compile('class="top_pic" src="(.+?)"').findall(page) fanart = xbmc.translatePath( os.path.join(__PLUGIN_PATH__, 'resources', 'bg', 'curtains.png')) if not iconImage == None and len(iconImage) > 0 and len( iconImage[0]) > 0: iconImage = common.getImage(iconImage[0], __NAME__) else: iconImage = '' if (len(sumMatch)) == 1: summary = sumMatch[0] common.addDir(contentType, title, url, self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary, fanart) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def showEpisodes(self, url): contentType,main_page = common.getData(url) episodeList = re.compile('<ol class="episode-list".*?</ol>').findall(main_page) episodes = re.compile('data-json.*?tooltipTitle":"(.*?)&.*?:"(.*?)".*?:"(.*?)&.*?href="(.*?)"').findall(episodeList[0]) for title, summary, img, url in episodes: episodeNum = re.compile('(\d.*?)/').findall(url)[0] contentType, page = common.getData('http://video2.walla.co.il/?w=null/null/' + episodeNum + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://i.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?95 tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://walla.co.il/ playpath=' + re.compile('<src>(.*?)</src>').findall(page)[0] common.addLink(contentType,title, url, iconImage, str(time), epiDetails) nextPage = re.compile('<a class="in_blk p_r" href="(.*?)" style=""></a>').findall(main_page) if (len(nextPage)) > 0: addDir('UTF-8',__language__(30001), __BASE_URL__ + nextPage[0], self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(500)")
def getEpisodeList(self, url): contentType,main_page = common.getData(url) episodes = re.compile('<div class="right item_small " style="">.*?<a href="(.*?)".*?</span><img src="(.*?)".*?<a.*?>(.*?)<').findall(main_page) for url, img, title in episodes: contentType,page = common.getData(__BASE_URL__ + url + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://i.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?95 tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://walla.co.il/ playpath=' + re.compile('<src>(.*?)</src>').findall(page)[0] common.addLink(contentType,title, url, iconImage, str(time), epiDetails) nextPage = re.compile('<a class="in_blk p_r" href="(.*?)" style=""></a>').findall(main_page) if (len(nextPage)) > 0: addDir('UTF-8',__language__(30001), __BASE_URL__ + nextPage[0], self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__ + '?w=/2225') urls = re.compile('(<div class="img".*?</div>)').findall(baseUrl) for url in urls: items = re.compile('<a href="(.*?)".*?<img src="(.*?)".*?<span.*?>(.*?)<').findall(url) for path, image, title in items: if (path.find('2224') != -1): contentType,page = common.getData(path + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWNE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://isc.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?275 pageUrl=' + path + ' playpath=' + re.compile('<src>(.*?)</src>').findall(page)[1] common.addLink(contentType,title, url, image, str(time), epiDetails) else: if not path.startswith("http://"): path = __BASE_URL__ + path common.addDir(contentType,title, path, self.MODES.GET_EPISODES_LIST, image, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def play_video(self, url, name): contentType, page = common.getData(url) videoId = re.compile('<embed.*?src=".+?(\d+)"').findall(page) if len(videoId) > 0: contentType, movieData = common.getData(__CLIP_DATA__ + videoId[0], 0) videoUrl = re.compile('<src>(.+?)</src>').findall(movieData) length = len(videoUrl) if length > 0: playUrl = videoUrl[ 0] + ' swfurl=http://intl.esperanto.mtvi.com/player/js/swfobject_2_2/expressInstall.swf swfvfy=true' #.replace('rtmpe', 'rtmp') listItem = xbmcgui.ListItem( name, 'DefaultFolder.png', 'DefaultFolder.png', path=playUrl ) # + '|' + 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') listItem.setInfo(type='Video', infoLabels={"Title": urllib.unquote(name)}) listItem.setProperty('IsPlayable', 'true') xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=listItem) ## http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri=mgid:uma:video:mtv.co.il:648596
def getSeriesList(self, url): ## get all the series base url contentType,baseUrl = common.getData(url) seriesBloc = re.compile('<ul class="fc sequence"(.*?)</ul>').findall(baseUrl) i = 1 for item in seriesBloc: urls = re.compile('<li.*?data-json="{"tooltipTitle":"(.*?)".*?:"(.*?)&.*?<a.*?href="(.*?)".*?class="img" src="(.*?)"').findall(item) for title, desc, url, img in urls: if i == 1: common.addDir('UTF-8', title, __BASE_URL__ + url, self.MODES.GET_EPISODES_LIST, img, __NAME__, desc) if i == 2: episodeNum = re.compile('/(\d.*)').findall(url)[0] contentType, page = common.getData('http://video2.walla.co.il/?w=null/null/' + episodeNum + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' playPath = re.compile('<src>(.*?)</src>').findall(page) length = len(playPath) url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://isc.walla.co.il/w9/swf/video_swf/vod/WallaMediaPlayerAvod.swf tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://vod.walla.co.il' + url + ' playpath=' + playPath[length -1] common.addLink(contentType,title, url, img, str(time), epiDetails) i=i+1 xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self, url): ## get all the series base url contentType,baseUrl = common.getData(url) seriesBloc = re.compile('<ul class="fc sequence"(.*?)</ul>').findall(baseUrl) print seriesBloc urls = re.compile('<li.*?data-json="{"tooltipTitle":"(.*?)".*?:"(.*?)&.*?itemtype="(.*?)".*?<a.*?href="(.*?)".*?class="img" src="(.*?)"').findall(baseUrl) for title, desc, type, url, img in urls: if type.endswith('Movie'): episodeNum = re.compile('/(\d.*)').findall(url)[0] contentType, page = common.getData('http://video2.walla.co.il/?w=null/null/' + episodeNum + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' playPath = re.compile('<src>(.*?)</src>').findall(page) length = len(playPath) url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://isc.walla.co.il/w9/swf/video_swf/vod/WallaMediaPlayerAvod.swf tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://vod.walla.co.il' + url + ' playpath=' + playPath[length -1] common.addLink('UTF-8', title, url, img, str(time), epiDetails) else: common.addDir('UTF-8', title, __BASE_URL__ + url, self.MODES.GET_EPISODES_LIST, img, __NAME__, desc) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getEpisodeList(self, url): contentType,main_page = common.getData(url) episodeList = re.compile('<ol class="episode-list".*?</ol>').findall(main_page) episodes = re.compile('data-json.*?tooltipTitle":"(.*?)&.*?:"(.*?)".*?:"(.*?)&.*?href="(.*?)"').findall(episodeList[0]) for title, summary, img, url in episodes: episodeNum = re.compile('(\d.*?)/').findall(url)[0] contentType, page = common.getData('http://video2.walla.co.il/?w=null/null/' + episodeNum + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://i.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?95 tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://walla.co.il/ playpath=' + re.compile('<src>(.*?)</src>').findall(page)[0] common.addLink(contentType,title, url, iconImage, str(time), epiDetails) nextPage = re.compile('<a class="in_blk p_r" href="(.*?)" style=""></a>').findall(main_page) if (len(nextPage)) > 0: addDir('UTF-8',__language__(30001), __BASE_URL__ + nextPage[0], self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__ + '?w=/2245') urls = re.compile('<div class="bottomBorder"><a href="(.*?)".*?><img src="(.+?)"').findall(baseUrl) ## for each series we get the series page to parse all the info from for path, image in urls: if path.startswith("http://"): contentType,page = common.getData(path) else: contentType,page = common.getData(__BASE_URL__ + path) details = re.compile('class="w3" style="margin-left:288px;">(\s.*)<div>(.*?)</div>(\s.*)<div>(.+?)<').findall(page) if (len(details)) > 0: summary = details[0][3] else: summary = '' iconImage = image fanartImage = re.compile('class="vbox720x330" src="(.+?)" alt="(.*?)"').findall(page) if not fanartImage == None: try: fanart = fanartImage[0][0] title = fanartImage[0][1] except: title = fanartImage urlMatch = re.compile('class="hd1 mrg_r1 none" style=""><a href="(.+?)"').findall(page) if (len(urlMatch)) > 0: common.addDir(contentType,title, __BASE_URL__ + urlMatch[0], self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary, fanart) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getEpisodeList(self, url): contentType,main_page = common.getData(url) episodes = re.compile('<div class="right item_small " style="">.*?<a href="(.*?)".*?</span><img src="(.*?)".*?<a.*?>(.*?)<').findall(main_page) for url, img, title in episodes: contentType,page = common.getData(__BASE_URL__ + url + '/@@/video/flv_pl') titleMatches = re.compile('<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall(page) if (len(titleMatches)) == 1: title = titleMatches[0][0] images = re.compile('<preview_pic>(.*?)</preview_pic>').findall(page) if (len(images)) >= 1: iconImage = images[0] details = re.compile('<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile('<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len(timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWBE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://i.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?95 tcurl=rtmp://waflaWBE.walla.co.il/vod/ pageurl=http://walla.co.il/ playpath=' + re.compile('<src>(.*?)</src>').findall(page)[0] common.addLink(contentType,title, url, iconImage, str(time), epiDetails) nextPage = re.compile('<a class="in_blk p_r" href="(.*?)" style=""></a>').findall(main_page) if (len(nextPage)) > 0: addDir('UTF-8',__language__(30001), __BASE_URL__ + nextPage[0], self.MODES.GET_EPISODES_LIST, 'DefaultFolder.png', __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'episodes') xbmc.executebuiltin("Container.SetViewMode(501)")
def getSeriesList(self): ## get all the series base url contentType, urls = common.getMatches( __BASE_URL__, '<a id="opc".*?href="(.*?)">(.*?)<') ## for each series we get the series page to parse all the info from for path in urls: if path[0].startswith("http://"): contentType, page = common.getData(path[0]) else: contentType, page = common.getData(__BASE_URL__ + path[0]) title = path[1] imageMatch = re.compile( 'class="stripe_title w7b white">(.*?)img\ssrc="(.*?)"' ).findall(page) details = re.compile('class="w3 nohvr">(.*?)<').findall(page) if (len(details)) > 0: summary = details[0] else: summary = '' if (len(imageMatch)) == 1: iconImage = common.getImage(imageMatch[0][1], __NAME__) urlMatch = re.compile( 'class="w6b fntclr2" href="(.*?)">').findall(page) if (len(urlMatch)) > 0: common.addDir(contentType, title, __BASE_URL__ + urlMatch[0], self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getSeriesList(self): ## get all the series base url contentType, baseUrl = common.getData(__BASE_URL__ + '?w=/2222') urls = re.compile( '<div class="bottomBorder"><a href="(.*?)".*?><img src="(.+?)" alt="(.+?)"' ).findall(baseUrl) ## for each series we get the series page to parse all the info from for path, image, title in urls: if path.startswith("http://"): contentType, page = common.getData(path) url = path else: contentType, page = common.getData(__BASE_URL__ + path) url = __BASE_URL__ + path iconImage = image fanartImage = re.compile( 'class="vbox720x330" src="(.+?)"').findall(page) if not fanartImage == None and len(fanartImage) > 0 and len( fanartImage[0]) > 0: fanart = fanartImage[0] else: fanart = '' common.addDir(contentType, title, url, self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, '', fanart) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self): ## get all the series base url contentType,urls = common.getMatches(__BASE_URL__,'<a id="opc" href="(.*?)"') ## for each series we get the series page to parse all the info from for path in urls: contentType,page = common.getData(__BASE_URL__ + path) titleMatches = re.compile('class="stripe_title w7b white">\s*(.*?)\s*</h1>\s*<img src="(.*?)"').findall(page) if len(titleMatches) == 0: # try a different possibility titleMatches = re.compile('class="stripe_title w7b white">.*?>(.*?)<.*?src="(.*?)"').findall(page) details = re.compile('class="w3 nohvr" style="line-height:17px;">(.*?)<').findall(page) if (len(details)) > 0: summary = details[0] else: summary = '' if (len(titleMatches)) == 1: title = titleMatches[0][0] iconImage = common.getImage(titleMatches[0][1],__NAME__) urlMatch = re.compile('class="w6b" href="(.*?)">').findall(page) if (len(urlMatch)) > 0: common.addDir(contentType,title, __BASE_URL__ + urlMatch[0], self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary) common.addDir(contentType,"ספיישל דייגו בספארי לבקשת הורי הפורום", __BASE_URL__ +'?w=//2562538', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) common.addDir(contentType,"דייגו מציל את חיות הים --מיוחד לאבות מסורים", __BASE_URL__ +'?w=//2545366', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) common.addDir(contentType,"הרפתקאות דורה ודייגו", __BASE_URL__ +'?w=//2505725', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def play_video(self, url, name): contentType,page = common.getData(url) videoId = re.compile('<embed.*?src=".+?(\d+)"').findall(page) if len(videoId) > 0: contentType,movieData = common.getData(__CLIP_DATA__ + videoId[0], 0) videoUrl = re.compile('<src>(.+?)</src>').findall(movieData) length = len(videoUrl) if length > 0: playUrl = videoUrl[0] + ' swfurl=http://intl.esperanto.mtvi.com/player/js/swfobject_2_2/expressInstall.swf swfvfy=true'#.replace('rtmpe', 'rtmp') listItem = xbmcgui.ListItem(name, 'DefaultFolder.png', 'DefaultFolder.png', path=playUrl) # + '|' + 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') listItem.setInfo(type='Video', infoLabels={ "Title": urllib.unquote(name)}) listItem.setProperty('IsPlayable', 'true') xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=listItem) ## http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri=mgid:uma:video:mtv.co.il:648596
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 form_post(): plug_id = request.form['plug_id'] startDate = request.form['startDate'] endDate = request.form['endDate'] offset = request.form['offset'] app.predictor = Facade(getData(plug_id, startDate, endDate, offset)) return render_template('index.html')
def getChapterList(self, url): ## get all the series base url contentType,baseUrl = common.getData(url) print baseUrl menuItems = re.compile('<div class="right channel_wrap">.*?href="(.*?)"').findall(baseUrl) chapterUrl = __BASE_URL__ + menuItems[1] common.getEpisodeList(__BASE_URL__, chapterUrl, __PATTERN__, __NAME__, self.MODES.GET_EPISODES_LIST, __PATTERN_FEATURED__, __PATTERN_MORE__)
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__)
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 getSeriesList(self, url): ## get all the series base url contentType,baseUrl = common.getData(url) seriesBloc = re.compile('<ul class="fc sequence"(.*?)</ul>').findall(baseUrl) urls = re.compile('<li.*?data-json="{"tooltipTitle":"(.*?)".*?:"(.*?)&.*?<a.*?href="(.*?)".*?class="img" src="(.*?)"').findall(baseUrl) for title, desc, url, img in urls: common.addDir('UTF-8', title, __BASE_URL__ + url, self.MODES.GET_EPISODES_LIST, img, __NAME__, desc) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self, url): ## get all the series base url contentType,baseUrl = common.getData(url) seriesBloc = re.compile('<ul class="fc sequence"(.*?)</ul>').findall(baseUrl) urls = re.compile('<li.*?data-json="{"tooltipTitle":"(.*?)".*?:"(.*?)&.*?<a.*?href="(.*?)".*?class="img" src="(.*?)"').findall(baseUrl) for title, desc, url, img in urls: common.addDir(contentType, title, __BASE_URL__ + url, self.MODES.GET_EPISODES_LIST, img, __NAME__, desc) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getVod(self, url): contentType, page = common.getData(url) features = re.findall( '<div class="topNav">(.*?)</div><span class="wcflow"', page) if features and len(features) > 0: menu = re.findall('href="(.*?)">(.*?)<', features[0]) for href, name in menu: common.addDir(contentType, name, __BASE_URL__ + href, self.MODES.GET_EPISODES_LIST, "DefaultFolder.png", __NAME__)
def getChapterList(self, url): ## get all the series base url contentType, baseUrl = common.getData(url) print baseUrl menuItems = re.compile( '<div class="right channel_wrap">.*?href="(.*?)"').findall(baseUrl) chapterUrl = __BASE_URL__ + menuItems[1] common.getEpisodeList(__BASE_URL__, chapterUrl, __PATTERN__, __NAME__, self.MODES.GET_EPISODES_LIST, __PATTERN_FEATURED__, __PATTERN_MORE__)
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__ + '?w=/2227') urls = re.compile('<div class="bottomBorder"><a href="(.*?)".*?><img src="(.+?)" alt="(.+?)"').findall(baseUrl) ## for each series we get the series page to parse all the info from for path, image, title in urls: if path.startswith("http://"): contentType,page = common.getData(path) url = path else: contentType,page = common.getData(__BASE_URL__ + path) url = __BASE_URL__ + path iconImage = image fanartImage = re.compile('</div><img src="(.+?)" width="940"').findall(page) if not fanartImage == None and len(fanartImage) > 0 and len(fanartImage[0]) > 0: fanart = fanartImage[0] else: fanart = '' common.addDir(contentType,title, url, self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, '', fanart) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def orderSelect(request): code=judge(request) if code=="success": jsons=jsonFromRequest(request) #jsons={"username":"******","password":"******"} username=jsons['username'] password=jsons['password'] code=getuser(username,password) if code==0: orders=order.objects.filter(username=username) orderList=[] for r in orders: p=[] datas={} i=list(orders).index(r) while i<len(orders): o=orders[i] if (not "order_no" in datas): data={} if jude_or(orderList,o.order_no): datas['order_no']=o.order_no datas['status']=o.status datas['time']=getTimestamp(o.time) data=getData(o) p.append(data) datas['product']=p else: break else: if datas['order_no']==o.order_no: data=getData(o) p.append(data) datas['product']=p i=i+1 if not datas=={}: orderList.append(datas) return responseWithJsonObject({"order":orderList}) else: return getBackdata(code) else: return code
def getSeriesList(self): ## get all the series base url contentType, baseUrl = common.getData(__BASE_URL__ + '?w=/2225') urls = re.compile('(<div class="img".*?</div>)').findall(baseUrl) for url in urls: items = re.compile( '<a href="(.*?)".*?<img src="(.*?)".*?<span.*?>(.*?)<' ).findall(url) for path, image, title in items: if (path.find('2224') != -1): contentType, page = common.getData(path + '/@@/video/flv_pl') titleMatches = re.compile( '<title>(.*?)</title>(.*)<subtitle>(.*?)<').findall( page) if (len(titleMatches)) == 1: title = titleMatches[0][0] details = re.compile( '<synopsis>(.*?)</synopsis>').findall(page) if (len(details)) > 0: epiDetails = details[0] timeInSeconds = re.compile( '<duration>(.*?)</duration>').findall(page) if not timeInSeconds == None and not len( timeInSeconds[0]) <= 0: time = int(timeInSeconds[0]) / 60 else: time = '00:00' url = 'rtmp://waflaWNE.walla.co.il/ app=vod/ swfvfy=true swfUrl=http://isc.walla.co.il/w9/swf/video_swf/vod/walla_vod_player_adt.swf?275 pageUrl=' + path + ' playpath=' + re.compile( '<src>(.*?)</src>').findall(page)[1] common.addLink(contentType, title, url, image, str(time), epiDetails) else: if not path.startswith("http://"): path = __BASE_URL__ + path common.addDir(contentType, title, path, self.MODES.GET_EPISODES_LIST, image, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__ + '?w=/2161') urls = re.compile('(<div class="img".*?</div>)').findall(baseUrl) for url in urls: items = re.compile('<a href="(.*?)".*?<img src="(.*?)".*?<span.*?>(.*?)<').findall(url) for path, image, title in items: if not path.startswith("http://"): path = __BASE_URL__ + path common.addDir(contentType,title, path, self.MODES.GET_EPISODES_LIST, image, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__ + '?w=/2162') urls = re.compile('(<div class="img".*?</div>)').findall(baseUrl) for url in urls: items = re.compile('<a href="(.*?)".*?<img src="(.*?)".*?<span.*?>(.*?)<').findall(url) for path, image, title in items: if not path.startswith("http://"): path = __BASE_URL__ + path common.addDir(contentType,title, path, self.MODES.GET_EPISODES_LIST, image, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(500)")
def getGenere(self, url): ## get all the series base url contentType, page = common.getData(url) genreBloc = re.compile('<nav class="sideNav".*?</nav>').findall(page) genres = re.compile('<li.*?href="(.*?)".*?"text">(.*?)<').findall(genreBloc[0]) i = 1 for url, title in genres: if i > 1: common.addDir('UTF-8', title, __BASE_URL__ + url, self.MODES.GET_SERIES_LIST, 'DefaultFolder.png', __NAME__) i = i + 1 xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(503)")
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__) urls = re.compile('class="opc".*?href="(.*?)".*?w3b">(.*?)<.*?src="(.*?)"').findall(baseUrl) ## for each series we get the series page to parse all the info from for path, title, img in urls: if path.startswith("http://"): url = path else: url = __BASE_URL__ + path common.addDir(contentType, title, url, self.MODES.GET_CHAPTERS, img, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getGenere(self, url): ## get all the series base url contentType, page = common.getData(url) genreBloc = re.compile('<nav class="sideNav".*?</nav>').findall(page) genres = re.compile('<li.*?href="(.*?)".*?"text">(.*?)<').findall(genreBloc[0]) i = 1 for url, title in genres: if i > 1: common.addDir('UTF-8', title, __BASE_URL__ + url, self.MODES.GET_SERIES_LIST, 'DefaultFolder.png', __NAME__) i = i + 1 xbmcplugin.setContent(int(sys.argv[1]), 'tvshows') xbmc.executebuiltin("Container.SetViewMode(503)")
def getSeriesList(self): ## get all the series base url contentType,urls = common.getMatches(__BASE_URL__,'<a id="opc".*?href="(.*?)">(.*?)<') ## for each series we get the series page to parse all the info from for path in urls: if path[0].startswith("http://"): contentType,page = common.getData(path[0]) else: contentType,page = common.getData(__BASE_URL__ + path[0]) title = path[1] imageMatch = re.compile('class="stripe_title w7b white">(.*?)img\ssrc="(.*?)"').findall(page) details = re.compile('class="w3 nohvr">(.*?)<').findall(page) if (len(details)) > 0: summary = details[0] else: summary = '' if (len(imageMatch)) == 1: iconImage = common.getImage(imageMatch[0][1], __NAME__) urlMatch = re.compile('class="w6b fntclr2" href="(.*?)">').findall(page) if (len(urlMatch)) > 0: common.addDir(contentType,title, __BASE_URL__ + urlMatch[0], self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getEpisodeList(self, url): contentType,main_page = common.getData(url) # check for seasons seasonsList = re.compile('<div class="drop".*?</div>').findall(main_page) if len(seasonsList) > 0: # we have seasons seasons = re.compile('<li>.*?href="(.*?)".*?</li>').findall(seasonsList[0]) i = 1 for season in seasons: common.addDir('UTF-8', __language__(30011) + ' ' + str(i), __BASE_URL__ + season, self.MODES.SHOW_EPISODES, '', __NAME__) i = i + 1 else: # we don't go directly to episodes self.showEpisodes(url)
def getSeriesList(self): ## get all the series base url contentType,urls = common.getMatches(__BASE_URL__,'<a class="block w3 fldevt goldsep red bold" href="(.+?)" onclick="Evt\(this,(\d),"(.+?)",3,"folder_new_prakim_melaim') ## for each series we get the series page to parse all the info from for path, num, title in urls: ## num is not used and does nothing. if path.startswith("http://"): contentType,page = common.getData(path) url = path else: contentType,page = common.getData(__BASE_URL__ + path) url = __BASE_URL__ + path sumMatch = re.compile('class="w3">(.*?)<').findall(page) iconImage = re.compile('class="top_pic" src="(.+?)"').findall(page) fanart = xbmc.translatePath(os.path.join(__PLUGIN_PATH__, 'resources', 'bg', 'curtains.png')) if not iconImage == None and len(iconImage) > 0 and len(iconImage[0]) > 0: iconImage = common.getImage(iconImage[0], __NAME__) else: iconImage = '' if (len(sumMatch)) == 1: summary = sumMatch[0] common.addDir(contentType,title, url, self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary, fanart) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getSeriesList(self): ## get all the series base url contentType, baseUrl = common.getData(__BASE_URL__) urls = re.compile( 'class="opc".*?href="(.*?)".*?w3b">(.*?)<.*?src="(.*?)"').findall( baseUrl) ## for each series we get the series page to parse all the info from for path, title, img in urls: if path.startswith("http://"): url = path else: url = __BASE_URL__ + path common.addDir(contentType, title, url, self.MODES.GET_CHAPTERS, img, __NAME__) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getSeriesList(self): ## get all the series base url contentType, urls = common.getMatches(__BASE_URL__, '<a id="opc" href="(.*?)"') ## for each series we get the series page to parse all the info from for path in urls: contentType, page = common.getData(__BASE_URL__ + path) titleMatches = re.compile( 'class="stripe_title w7b white">\s*(.*?)\s*</h1>\s*<img src="(.*?)"' ).findall(page) if len(titleMatches) == 0: # try a different possibility titleMatches = re.compile( 'class="stripe_title w7b white">.*?>(.*?)<.*?src="(.*?)"' ).findall(page) details = re.compile( 'class="w3 nohvr" style="line-height:17px;">(.*?)<').findall( page) if (len(details)) > 0: summary = details[0] else: summary = '' if (len(titleMatches)) == 1: title = titleMatches[0][0] iconImage = common.getImage(titleMatches[0][1], __NAME__) urlMatch = re.compile('class="w6b" href="(.*?)">').findall( page) if (len(urlMatch)) > 0: common.addDir(contentType, title, __BASE_URL__ + urlMatch[0], self.MODES.GET_EPISODES_LIST, iconImage, __NAME__, summary) common.addDir(contentType, "ספיישל דייגו בספארי לבקשת הורי הפורום", __BASE_URL__ + '?w=//2562538', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) common.addDir(contentType, "דייגו מציל את חיות הים --מיוחד לאבות מסורים", __BASE_URL__ + '?w=//2545366', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) common.addDir(contentType, "הרפתקאות דורה ודייגו", __BASE_URL__ + '?w=//2505725', self.MODES.GET_EPISODES_LIST, "", __NAME__, summary) xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
def getEpisodeList(self, url): contentType, main_page = common.getData(url) # check for seasons seasonsList = re.compile('<div class="drop".*?</div>').findall( main_page) if len(seasonsList) > 0: # we have seasons seasons = re.compile('<li>.*?href="(.*?)".*?</li>').findall( seasonsList[0]) i = 1 for season in seasons: common.addDir('UTF-8', __language__(30011) + ' ' + str(i), __BASE_URL__ + season, self.MODES.SHOW_EPISODES, '', __NAME__) i = i + 1 else: # we don't go directly to episodes self.showEpisodes(url)
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__)
averageInput = [] averageOutput = [] for _ in range(96): averageInput.append(0) averageOutput.append(0) for i in range(1, 6): plug = str(i) day = 1 initialDate = '' data = [] while initialDate.split('T')[0] != endDate.split('T')[0]: initialDate = f'2018-08-{day:02d}T00:00:00.000Z' finalDate = f'2018-08-{day:02d}T23:59:59.999Z' newData = getData(plug, initialDate, finalDate, 'false') if (sum(newData) != 0): data.append(newData) day += 1 print('data has ', day, 'days') initialCost = 0 calculatedCost = 0 for j in range(len(data)): for k in range(len(data[j])): averageInput[k] += data[j][k] print('adding inputs') data[j] = Facade(data[j]) initialCost += data[j].inputPrice for _ in range(50): data[j].nextGen()
import stages import common info = { 'email': '*****@*****.**', 'github': 'https://github.com/eduardoramirez/code2040' } token = common.getToken(info) # run problem 1 print "Running Stage I..." string = common.getData('/api/getstring', token)['result'] reverse = stages.stageI(string) common.sendData('/api/validatestring', token, ('string', reverse)) #run problem 2 print "Running Stage II..." info = common.getData('/api/haystack', token)['result'] needle = info['needle'] haystack = info['haystack'] index = stages.stageII(needle, haystack) common.sendData('/api/validateneedle', token, ('needle', index)) # run problem 3 print "Running Stage III..." info = common.getData('/api/prefix', token)['result'] prefix = info['prefix'] strings = info['array']
def getSeriesList(self): ## get all the series base url contentType,baseUrl = common.getData(__BASE_URL__) urls = re.compile('<a class="in_blk tbBtn" href="\/(.+?)"').findall(baseUrl) url = urls[0] ## first is the url we need. common.getEpisodeList(__BASE_URL__, __BASE_URL__ + url, __PATTERN__, __NAME__, self.MODES.GET_EPISODES_LIST, __PATTERN_FEATURED__)
import os import platform import subprocess from pathlib import Path from ast import literal_eval from pprint import pprint import common data = common.getData() if data is not None: if platform.system() == "Windows": launcherPath = data["CurPath"] / (common.formatFileName(data["GameName"]) + ".exe") launcherFallbackPath = [f for f in data["CurPath"].iterdir() if f.name.endswith(".exe") and f.is_file()] launcherFallbackPath = launcherFallbackPath[0] if len(launcherFallbackPath) > 0 else data["CurPath"] / ("BGArmor.exe") enginePaths = data["EngineExecutables"] if not launcherPath.exists(): launcherPath = launcherFallbackPath if launcherPath.exists(): command = '?./source/tools/Windows/ResourceHacker.exe? ' command += '-open ?' + launcherPath.as_posix() + '? ' command += '-save ?' + launcherPath.as_posix() + '? ' command += '-action addoverwrite -res ?./source/icons/icon-launcher.ico? ' command += '-mask ICONGROUP,APPICON,' command = command.replace('?', data["Quote"]) print("\n> Setting icon of launcher...") print("Command:", command)
from common import getData, pushData import time if __name__ == "__main__": while True: sensor = 22 pin = 4 humidity, temp = getData(sensor, pin) pushData(temp, humidity) time.sleep(10)