def ParseMainList(self): #get base items and add some other categories items = chn_class.Channel.ParseMainList(self) #remove xxx category items.pop() recent = common.clistItem("Meest recente video's", "%s/video.asp?So=0" % self.mainListUri) recent.icon = self.folderIcon items.insert(0, recent) best = common.clistItem("Best beoordeelde video's", "%s/video.asp?So=2" % self.mainListUri) best.icon = self.folderIcon items.insert(0, best) watched = common.clistItem("Meest bekeken video's", "%s/video.asp?So=1" % self.mainListUri) watched.icon = self.folderIcon items.insert(0, watched) spoken = common.clistItem("Meest besproken video's", "%s/video.asp?So=2" % self.mainListUri) spoken.icon = self.folderIcon items.insert(0, spoken) # <a onfocus="this.blur();" href="/video.asp?So=0" title="Meest recente video's" onmouseover="fOver(this);return true;">Meest recente video's</a> | # <a onfocus="this.blur();" href="/video.asp?So=2" title="Best beoordeelde video's" onmouseover="fOver(this);return true;">Best beoordeelde video's</a> | # <a onfocus="this.blur();" href="/video.asp?So=1" title="Meest bekeken video's" onmouseover="fOver(this);return true;">Meest bekeken video's</a> | # <a onfocus="this.blur();" href="/video.asp?So=3" title="Meest besproken video's" onmouseover="fOver(this);return true;">Meest besproken video's</a> return items
def ParseMainList(self): """ Add some custom categories here """ items = [] item = common.clistItem("Nieuwste videos", "http://www.myvideo.nl/news.php?rubrik=rljgs") item.icon = self.folderIcon items.append(item) item = common.clistItem("Meest bekeken videos", "http://www.myvideo.nl/news.php?rubrik=tjyec") item.icon = self.folderIcon items.append(item) item = common.clistItem("Meest besproken videos", "http://www.myvideo.nl/news.php?rubrik=vpjpr") item.icon = self.folderIcon items.append(item) item = common.clistItem("Best beoordeelde videos", "http://www.myvideo.nl/news.php?rubrik=xayvg") item.icon = self.folderIcon items.append(item) item = common.clistItem("Favoriete videos", "http://www.myvideo.nl/news.php?rubrik=pcvbc") item.icon = self.folderIcon items.append(item) return items + chn_class.Channel.ParseMainList(self)
def ParseMainList(self): #get base items and add some other categories items = chn_class.Channel.ParseMainList(self) items = [] nuevoitem = common.clistItem("Recomendados", "http://www.rtve.es/alacarta/todos/recomendados/index.html" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Últimos 7 días", "http://www.rtve.es/alacarta/todos/ultimos/index.html" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Temas", "http://www.rtve.es/alacarta/todos/temas/index.html" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Todos A-Z", "http://www.rtve.es/alacarta/todos/abecedario/index.html" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Archivo TVE", "http://www.rtve.es/alacarta/archivo/index.html" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) self.mainListItems = items return items
def PreProcessFolderList(self, data): """ Accepts an data from the ProcessFolderList Methode, BEFORE the items are processed. Allows setting of parameters (like title etc). No return value! """ logFile.info("Performing Pre-Processing") _items = [] # Desde que numero debe empezar numeros = common.DoRegexFindAll("javascript:send\('frmSearcher',(\d+)\)", data) #<input type="hidden" name="acat" value="TINFANTIL"/> categoria = common.DoRegexFindAll('<input type="hidden" name="acat" value="([^"]+)"', data) #<input type="hidden" name="endDate" value="01/02/2009"/> fecha = common.DoRegexFindAll('<input type="hidden" name="endDate" value="([^"]+)"', data) logFile.debug(numeros) logFile.debug(categoria[0]) logFile.debug(fecha[0]) # Si hay 2, coger el primero # Si hay 4, coger los dos primeros if len(numeros) == 2: logFile.debug("hay 2 paginadores") txthiStartValue = numeros[0] urlpaginador = "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?hiPortal=tvc&hiSearchEngine=lucene&hiAdvanced=1&hiSearchIn=0&maxRowsDisplay=50&hiStartValue=" + txthiStartValue + "&hiTarget=searchingVideos.jsp&acat=" + categoria[0] + "&hiCategory=VID&textBusca=&startDate=&endDate=" + fecha[0].replace("/","%2F") logFile.debug(urlpaginador) nuevoitem = common.clistItem("Siguiente", urlpaginador ) nuevoitem.description = "" nuevoitem.icon = self.folderIcon nuevoitem.thumb = self.noImage nuevoitem.complete = True nuevoitem.type = 'folder' _items.append(nuevoitem) else: logFile.debug("hay 4 paginadores") txthiStartValue = numeros[0] urlpaginador = "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?hiPortal=tvc&hiSearchEngine=lucene&hiAdvanced=1&hiSearchIn=0&maxRowsDisplay=50&hiStartValue=" + txthiStartValue + "&hiTarget=searchingVideos.jsp&acat=" + categoria[0] + "&hiCategory=VID&textBusca=&startDate=&endDate=" + fecha[0].replace("/","%2F") logFile.debug(urlpaginador) nuevoitem = common.clistItem("Anterior", urlpaginador ) nuevoitem.description = "" nuevoitem.icon = self.folderIcon nuevoitem.thumb = self.noImage nuevoitem.complete = True nuevoitem.type = 'folder' _items.append(nuevoitem) txthiStartValue = numeros[1] urlpaginador = "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?hiPortal=tvc&hiSearchEngine=lucene&hiAdvanced=1&hiSearchIn=0&maxRowsDisplay=50&hiStartValue=" + txthiStartValue + "&hiTarget=searchingVideos.jsp&acat=" + categoria[0] + "&hiCategory=VID&textBusca=&startDate=&endDate=" + fecha[0].replace("/","%2F") logFile.debug(urlpaginador) nuevoitem = common.clistItem("Siguiente", urlpaginador ) nuevoitem.description = "" nuevoitem.icon = self.folderIcon nuevoitem.thumb = self.noImage nuevoitem.complete = True nuevoitem.type = 'folder' _items.append(nuevoitem) return (data, _items)
def ParseMainList(self): # call the main list items = [] if len(self.mainListItems) > 1: return self.mainListItems items = chn_class.Channel.ParseMainList(self) # get more items: url1 = "http://www.rtl.nl/service/gemist/home/" data1 = uriHandler.Open(url1, pb=True) url2 = common.DoRegexFindAll( '<script[^>]+src="([^"]+)"[^>]*></script><div id="navigatie_container">', data1) javaUrl = "" for url in url2: javaUrl = url pass if javaUrl != "": data = uriHandler.Open(javaUrl, pb=True) moreItems = common.DoRegexFindAll( '\["([^"]+)","([^"]+)","[^"]+","[^"]+"\]', data) previousNumber = len(items) number = 0 for item in moreItems: moreItem = common.clistItem( item[0], self.RtlFolderUri("/%s" % item[1], "videomenu.xml")) moreItem.icon = self.folderIcon moreItem.thumb = self.noImage if items.count(moreItem) == 0: number = number + 1 items.append(moreItem) logFile.debug("Added %s more RTL Items to the already existing %s", number, previousNumber) rockNationItem = common.clistItem( 'Rock Nation', 'http://www.rtl.nl/system/video/menu/reality/rocknation/videomenu.xml', 'folder') rockNationItem.icon = self.folderIcon rockNationItem.thumb = self.noImage if items.count(rockNationItem) == 0: items.append(rockNationItem) # sort by name if self.episodeSort: items.sort(lambda x, y: cmp(x.name.lower(), y.name.lower())) return items
def ParseMainList(self): #get base items and add some other categories items = chn_class.Channel.ParseMainList(self) items = [] nuevoitem = common.clistItem("Sèries", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TSERIES" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Actualitat", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TACTUALITA" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Esports", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TESPORTS" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Cuina", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TCUINA" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Entretenimient", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TENTRETENI" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Divulgació", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TDIVULGACI" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Juvenil", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TJUVENIL" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Infantil", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TINFANTIL" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Música", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TMUSICA" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) nuevoitem = common.clistItem("Gent TVC", "http://www.tv3.cat/searcher/tvc/searchingVideos.jsp?acat=TGENTTVC" ) nuevoitem.icon = self.folderIcon items.append(nuevoitem) self.mainListItems = items return items
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) logFile.debug(resultSet) try: titulo = unicode( resultSet[2].strip(), "utf-8" ).encode("iso-8859-1") except: titulo = resultSet[2].strip() logFile.debug("titulo="+titulo) url = urlparse.urljoin(self.baseUrl,resultSet[0]) logFile.debug("url="+url) item = common.clistItem( titulo , url ) descripcion = "%s" % resultSet[3] descripcion = descripcion.strip() descripcion = descripcion.replace("</p>","") descripcion = descripcion.replace("<p>","") descripcion = common.ConvertHTMLEntities(descripcion) try: item.description = unicode( descripcion, "utf-8" ).encode("iso-8859-1") except: item.description = descripcion item.thumbUrl = urlparse.urljoin(self.baseUrl,resultSet[1]) item.date = "." item.icon = "newmovie.png" item.type = 'video' item.complete = False return item
def TopItems(self): """ Gets the top 50 items """ #check for cookie: logFile.info("Checking for NOS cookies.") if uriHandler.CookieCheck('UGSES') and uriHandler.CookieCheck('CheckUGCookie'):# and uriHandler.CookieCheck('quuid'): logFile.info("Cookies found. Continuing") else: logFile.info("No cookies found. Opening main site") temp = uriHandler.Open(self.baseUrl) items = [] data = uriHandler.Open("http://www.uitzendinggemist.nl/index.php/top50") results = common.DoRegexFindAll('<td style=[^>]+><a href="/index.php/aflevering(\?aflID=\d+&md5=[^"]+)">([^<]+)</a></td>\W+<td align="right">([^<]+)</td>', data) logFile.debug("Adding %s top50 items", len(results)) for result in results: tmp = common.clistItem(result[1], common.StripAmp(result[0])) tmp.icon = self.icon tmp.date = result[2] tmp.type = 'video' items.append(tmp) return items
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) #logFile.debug(resultSet) item = common.clistItem(resultSet[3], urlparse.urljoin(self.baseUrl, resultSet[2])) item.thumb = self.noImage item.icon = self.icon if (resultSet[0] != ""): item.thumbUrl = urlparse.urljoin(self.baseUrl, resultSet[1]) else: item.thumbUrl = "" item.date = resultSet[4] item.description = resultSet[6] if item.description == "": item.description = item.name item.type = 'video' item.complete = False return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) logFile.debug("###") logFile.debug(resultSet) # http://www.tv3.cat/videos/902809/El-cor---Capitol-1695 /videos/983419/El-cor---Capitol-1718 # "La Franny i les sabates màgiques - 28/01/2009" titulo = resultSet[2][0:-13] logFile.debug("titulo="+titulo) fecha = resultSet[2][-10:] logFile.debug("fecha="+fecha) item = common.clistItem( titulo + " - " + resultSet[3] , "http://www.tv3.cat%s" % resultSet[0] ) item.thumb = self.noImage item.thumbUrl = resultSet[1] item.date = fecha item.icon = "newmovie.png" item.description = resultSet[4] item.type = 'video' item.complete = False return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) logFile.debug(resultSet) #/reproductor/inicio.asp?canal=tele&hora=09/02/2009 21:35:16&fecha=03/02/2009&arquivo=1&programa=ALAL\xc1&id_programa=7 urldetalle = resultSet[0].replace("&","&") urldetalle = urldetalle.replace(" ","%20") urldetalle = "http://www.crtvg.es" + urldetalle titulo = common.DoRegexFindAll("programa=([^&]+)&", resultSet[0]) item = common.clistItem( titulo[0] , urldetalle ) #item.thumb = self.noImage item.thumbUrl = "http://www.crtvg.es"+resultSet[1] item.thumb = self.CacheThumb(item.thumbUrl) fechavideo = common.DoRegexFindAll("fecha=([^&]+)&", resultSet[0]) item.date = fechavideo[0] item.icon = "newmovie.png" item.description = resultSet[2] item.type = 'video' item.complete = False return item
def ProcessFolderList(self, url): logFile.info('starting ParseFolder for '+url) items = [] # get the data for most current episode try: # load first page as "pageBase" data = uriHandler.Open(url, pb=True) # see if it is an extended page or not: extended = common.DoRegexFindAll('<u>terug naar programma</u>', data) if extended != []: items = self.ProcessExtendedPages(data) else: items = self.ProcessNormalPage(data) # determine if an extended page item should be added pageExtUrl = common.DoRegexFindAll('<a href="(/index.php/serie2\?serID=\d+&md5=[0-9a-f]+)"', data) if pageExtUrl != []: # add an folder item for it to the list folderItem = common.clistItem("Oudere afleveringen", self.baseUrl + common.StripAmp(pageExtUrl[0]), type='folder') folderItem.icon = self.folderIcon folderItem.thumb = self.noImage folderItem.description = "Oudere, gearchiveerde items van '%s'." % items[0].name #items.append(folderItem) items.insert(0,folderItem) return items except: logFile.critical("Error Parsing with new methode", exc_info=True) return items
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) logFile.debug(resultSet) """ ( 0 '<a href="javascript:launchOverdrive(\'name=ontv\',\'id=106960\');">Fur TV - Episode 101 </a>' 1 'id=106960' 2 'Fur TV - Episode 101 ' 3, '' 4, 'test' 5, '' 6, 'test') """ item = common.clistItem( "%s%s%s" % (resultSet[2], resultSet[4], resultSet[6]), "%s/content.jhtml?%s" % (self.baseUrl, resultSet[1])) item.icon = self.icon item.type = 'video' item.complete = False return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ item = common.clistItem(resultSet[1], "http://www.rtl.nl/(vm="+ resultSet[0] + ")/system/video/menu" + resultSet[0] + "videomenu.xml") item.icon = self.folderIcon return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.debug('starting FormatVideoItem for %s', self.channelName) item = common.clistItem( resultSet[1].title(), "http://www.123video.nl/playvideo.asp?MovieID=%s" % resultSet[0]) item.icon = self.icon item.type = 'video' item.date = resultSet[3].lstrip() item.description = item.name if len(resultSet[0]) == 6: item.mediaurl = "http://%s/%s/%s.flv" % ( self.ipVideoServer, resultSet[0][0:3], resultSet[0]) elif len(resultSet[0]) == 5: item.mediaurl = "http://%s/%s/%s.flv" % ( self.ipVideoServer, resultSet[0][0:2], resultSet[0]) elif len(resultSet[0]) == 4: item.mediaurl = "http://%s/%s/%s.flv" % ( self.ipVideoServer, resultSet[0][0:1], resultSet[0]) else: item.mediaurl = "" #logFile.debug("len=%s (%s), %s", len(resultSet[0]) ,resultSet[0], item.mediaurl) #Do this on mouseover #item.thumb = self.CacheThumb(resultSet[2]) item.thumbUrl = resultSet[2] item.complete = False return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) logFile.debug(resultSet) titulo = resultSet[1] logFile.debug("titulo="+titulo) url = "http://www.rtvv.es/alacarta/secciones.asp"+resultSet[0].replace("&","&") logFile.debug("url="+url) item = common.clistItem( titulo , url ) descripcion = "%s" % resultSet[2] descripcion = descripcion.strip() descripcion = descripcion.replace("</a>","") descripcion = descripcion.replace("</p>","") descripcion = descripcion.replace("<p>","") item.description = common.ConvertHTMLEntities(descripcion) item.thumbUrl = urlparse.urljoin(self.baseUrl,resultSet[3]).replace(" ","%20") # TODO: Sacar la fecha de la descripcion matches = common.DoRegexFindAll("<p>Emissió: ([^<]+)<", resultSet[2]) item.date = "." if len(matches)>0: item.date = matches[0] item.icon = "newmovie.png" item.type = 'video' item.complete = False return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('******* NO SIRVE') item = common.clistItem( "null", "null" ) return item
def initPlugin(self): """ Special initialisation for plugin version """ # create dummy history item self.folderHistory.append(common.clistItem("Dummy Plugin item", "")) self.pluginMode = True
def PlayVideoItem(self, item, lowBitrate=False, player=""): # overriding the default playvideoitem to allow selection of low and high bitrate #if len(item.mediaurl) > 1: if type(item.mediaurl) is types.ListType or type(item.mediaurl) is types.TupleType: # create dummy item for playback dummy = common.clistItem(item.name, item.url, item.type) dummy.complete = True #select the right url if not lowBitrate: dummy.mediaurl = item.mediaurl[0] logFile.debug("Starting playback of the high bitrate mediaUrl (%s)", dummy.mediaurl) else: dummy.mediaurl = item.mediaurl[-1] logFile.debug("Starting playback of the low bitrate mediaUrl (%s)", dummy.mediaurl) # parse it #if self.parseWvx: # dummy = self.ParseWvx(dummy) # play it chn_class.Channel.PlayVideoItem(self, dummy, player) else: logFile.debug("Starting playback of the only available mediaUrl (%s)", item.mediaurl) #if self.parseWvx: # dummy = self.ParseWvx(dummy) chn_class.Channel.PlayVideoItem(self, item, player)
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) #logFile.debug(resultSet) # 0 = href 1 = image #<div class="image">\W+<a href="([^"]+)"><img src="([^"]+)" alt="[^"]+" /></a>\W+</div>\W[^:]+<span class="epnumber"> # 2 = number 3 = title 4 = date 5 = desc #Episode: \d(\d+)</span>\W+<span[^>]+>([^<]+)</span>\W+<span class="epdate">([^<]+)</span>\W+<span class="epdesc">([^/]+)</span> # 6 = episode id #\W+</a>\W+<div class="more">\W+<a href="/episodes/(\d+)/"item = common.clistItem("%s %s" % (resultSet[2], resultSet[3]), urlparse.urljoin(self.baseUrl, resultSet[0])) infoUrl = "http://media.mtvnservices.com/video/feed.jhtml?type=network&uri=mgid%3Acms%3Acontent%3Asouthparkstudios.com%3A" + resultSet[6] item = common.clistItem("%s %s" % (resultSet[2], resultSet[3]), infoUrl) item.thumb = self.noImage item.thumbUrl = resultSet[1] item.date = resultSet[4] item.icon = self.icon item.description = resultSet[5] item.type = 'video' item.complete = False return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s %s', self.channelName , resultSet[1]) #logFile.debug(self) #logFile.debug(resultSet) titulo = resultSet[1].replace("á","Á") titulo = titulo.replace("é","É") titulo = titulo.replace("í","Í") titulo = titulo.replace("ó","Ó") titulo = titulo.replace("ú","Ú") titulo = titulo.replace("ñ","Ñ") titulo = titulo.replace('Á','Á') titulo = titulo.replace('É','É') titulo = titulo.replace('Í','Í') titulo = titulo.replace('Ó','Ó') titulo = titulo.replace('Ú','Ú') titulo = titulo.replace('ñ','ñ') titulo = titulo.replace('Ñ','Ñ') # <li><a href="(/guide/season/[^"]+)">(\d+)</a></li> #item = common.clistItem( resultSet[1] , urlparse.urljoin(self.baseUrl, resultSet[0])) item = common.clistItem( titulo , 'http://www.radiotelevisionandalucia.es/tvcarta/impe/web/portada' ) #item = common.clistItem( resultSet[1] , resultSet[1]) item.complete = True item.icon = self.folderIcon return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ # if el titulo no coincide con el del programa, no lo añade a la lista # la pagina de resultados de RTVA contiene todos los programas, no solo el resultado de la busqueda #logFile.debug('starting CreateVideoItem for %s %s %s', self.channelName , resultSet[1] , resultSet[2] ) #logFile.debug(resultSet) #logFile.debug('**** elegido=%s' , self.elegido) programa = self.mainListItems[self.elegido].name titulo = resultSet[1].replace('Á','Á') titulo = titulo.replace('É','É') titulo = titulo.replace('Í','Í') titulo = titulo.replace('Ó','Ó') titulo = titulo.replace('Ú','Ú') titulo = titulo.replace('Ñ','Ñ') #logFile.debug( titulo ) #logFile.debug( programa ) #logFile.debug('--- folderHistory') #logFile.debug(len(self.folderHistory)) #logFile.debug(self.folderHistory) #logFile.debug(len(self.folderHistory[0].items)) #logFile.debug(len(self.folderHistory[-1].items)) #logFile.debug('--- folderHistorySelectedPosition') #logFile.debug(self.folderHistorySelectedPosition) #logFile.debug('--- listItems') #logFile.debug(len(self.listItems)) #logFile.debug(self.listItems) #logFile.debug('--- mainListItems') #logFile.debug(len(self.mainListItems)) #logFile.debug(self.mainListItems) #logFile.debug('--- self.currentPosition') #logFile.debug(self.currentPosition) #logFile.debug(self.getCurrentListPosition()) titulocapitulo = ( "%s %s %s %s" % (resultSet[2],resultSet[3],resultSet[4],resultSet[5])) titulocapitulo = titulocapitulo.replace('Á','Á') titulocapitulo = titulocapitulo.replace('É','É') titulocapitulo = titulocapitulo.replace('Í','Í') titulocapitulo = titulocapitulo.replace('Ó','Ó') titulocapitulo = titulocapitulo.replace('Ú','Ú') titulocapitulo = titulocapitulo.replace('ñ','ñ') titulocapitulo = titulocapitulo.replace('Ñ','Ñ') item = common.clistItem( titulocapitulo , urlparse.urljoin(self.baseUrl, resultSet[0]) ) item.thumb = self.noImage item.thumbUrl = resultSet[6] item.date = "01/01/2009" item.icon = "newmovie.png" item.description = ( "%s %s %s %s" % (resultSet[2],resultSet[3],resultSet[4],resultSet[5])) item.complete = False if titulo == programa: item.type = 'video' logFile.debug( 'item.url=%s' , item.url ) else: item.type = 'null' return item
def CreateAppendItem(self, resultSet, pageNr): """ Accepts an resultset """ item = common.clistItem("Page %s" % pageNr, "%s%s%s" % (self.mainListUri, resultSet[0], pageNr), type="append") item.icon = self.appendIcon item.thumb = self.noImage return item
def ParseMainList(self): """ accepts an url and returns an list with items of type CListItem Items have a name and url. This is used for the filling of the progwindow """ items = [] for page in range(0, 10): item = common.clistItem("Pagina %s" % (page), self.mainListUri % (page)) item.icon = self.icon items.append(item) item = common.clistItem("Zoeken", "searchSite") item.icon = self.icon items.append(item) return items
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ item = common.clistItem(resultSet[0], "http://www.freecaster.com/helpers/videolist_helper.php?apID=%s&i=0&q=&sortby=date&sort=DESC&event_id=" % resultSet[1]) item.icon = self.icon item.complete = True return item
def ParseMainList(self): # call the main list items = [] if len(self.mainListItems) > 1: return self.mainListItems items = chn_class.Channel.ParseMainList(self) # get more items: url1 = "http://www.rtl.nl/service/gemist/home/" data1 = uriHandler.Open(url1, pb=True) url2 = common.DoRegexFindAll('<script[^>]+src="([^"]+)"[^>]*></script><div id="navigatie_container">', data1) javaUrl = "" for url in url2: javaUrl = url pass if javaUrl != "": data = uriHandler.Open(javaUrl, pb=True) moreItems = common.DoRegexFindAll('\["([^"]+)","([^"]+)","[^"]+","[^"]+"\]', data) previousNumber = len(items) number = 0 for item in moreItems: moreItem = common.clistItem(item[0], self.RtlFolderUri("/%s" % item[1], "videomenu.xml")) moreItem.icon = self.folderIcon moreItem.thumb = self.noImage if items.count(moreItem) == 0: number = number + 1 items.append(moreItem) logFile.debug("Added %s more RTL Items to the already existing %s", number, previousNumber) rockNationItem = common.clistItem('Rock Nation','http://www.rtl.nl/system/video/menu/reality/rocknation/videomenu.xml', 'folder') rockNationItem.icon = self.folderIcon rockNationItem.thumb = self.noImage if items.count(rockNationItem) == 0: items.append(rockNationItem) # sort by name if self.episodeSort: items.sort(lambda x, y: cmp(x.name.lower(),y.name.lower())) return items
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s', self.channelName) item = common.clistItem(resultSet[1], self.baseUrl + resultSet[0]) item.icon = self.icon item.complete = False return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ item = common.clistItem( resultSet[1], "http://www.rtl.nl/(vm=" + resultSet[0] + ")/system/video/menu" + resultSet[0] + "videomenu.xml") item.icon = self.folderIcon return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) #<li><a href="(videos\?c=\d+)">([^<]+)</a></li> item = common.clistItem(resultSet[1], "http://quicksilverscreen.com/%s" % (resultSet[0])) item.icon = self.folderIcon return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateVideoItem for %s', self.channelName) item = common.clistItem("No CreateVideoItem Implented!", "") item.complete = True return item
def DisplayFolderList(self, items, position): """ Accepts an list of items and fills the windowlist. Clearing windows, Restore previous states and filling. """ logFile.debug("DisplayFolderList needs to display %s items. \nFocussed is on item %s", len(items), position) self.window.clearList() if len(items)==0: logFile.debug("Adding Dummy Item") tmp = common.clistItem("No Files", "") tmp.complete = True tmp.thumb = self.window.noImage tmp.icon = self.window.icon items.append(tmp) # check if a progressbar is needed: pbEnabled = len(items) > self.progressBarItemLimit if pbEnabled: logFile.info("Using Progressbar to display %s items", len(items)) percentagePerItem = 100.0/len(items) itemNr = 0 progDialog = xbmcgui.DialogProgress() progDialog.create("Please Wait...", "Adding Items to list") for item in items: if not item.type == "page": tmp = xbmcgui.ListItem(item.name, item.date, item.icon, item.icon) self.window.addItem(tmp) if pbEnabled: itemNr = itemNr + 1 progDialog.update(int(percentagePerItem * itemNr), "Adding Items to list", "Adding item %s of %s" % (itemNr, len(items))) if progDialog.iscanceled() == True: break if pbEnabled: progDialog.close() self.window.setFocus(self.window.getControl(controls.EP_LIST)) self.window.setCurrentListPosition(position) if not self.window.listItems[position].complete: item = self.window.UpdateVideoItem(self.window.listItems[position]) # if the mediaUrl is not filled: item is not complete (DOES NOT WORK WELL) if item.mediaurl == "": item.complete = False # check if the list has not changed during upate: if self.window.listItems[position].Equals(item): logFile.info("Updating item (GUIDs match)") self.window.listItems[position] = item else: logFile.error("Aborting Update because of GUID mismatch") # if somehow the list focus was already changed, don't update if self.window.getCurrentListPosition() == position: logFile.info("All items where shown. Now fetching focussed item info for item number %s", position) self.ShowData(self.window.listItems[position])
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) item = common.clistItem(resultSet[1], "http://www.kanalenkiezer.nl%s" % (resultSet[0],)) item.icon = self.icon item.complete = True return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s', self.channelName) # dummy class _item = common.clistItem("No CreateEpisode Implented!", "") _item.complete = True return _item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) #<li><a href="(videos\?c=\d+)">([^<]+)</a></li> item = common.clistItem( resultSet[1], "http://quicksilverscreen.com/%s" % (resultSet[0])) item.icon = self.folderIcon return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) item = common.clistItem( resultSet[1], "http://www.123video.nl/video.asp?CatID=%s" % resultSet[0]) item.icon = self.folderIcon return item
def ShowListItems(self, items): self.getControl(controls.PR_LIST).reset() if len(items) == 0: # add dummy item tmp = common.clistItem("No Files", "") tmp.complete = True items.append(tmp) for m in items: self.getControl(controls.PR_LIST).addItem(xbmcgui.ListItem(m.name, m.date, m.icon, m.icon))
def SearchSite(self): """ Creates an list of items by searching the site """ items = [] item = common.clistItem("Search Not Implented","", type="video") item.icon = self.icon items.append(item) return items
def SearchSite(self): """ Creates an list of items by searching the site """ items = [] item = common.clistItem("Search Not Implented", "", type="video") item.icon = self.icon items.append(item) return items
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ item = common.clistItem( resultSet[0], "http://www.freecaster.com/helpers/videolist_helper.php?apID=%s&i=0&q=&sortby=date&sort=DESC&event_id=" % resultSet[1]) item.icon = self.icon item.complete = True return item
def CreateVideoItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ item = common.clistItem(resultSet[1],"http://www.kanalenkiezer.nl%s" % (resultSet[0],)) item.description = resultSet[2] item.icon = self.icon item.rating = int(resultSet[3]) item.complete = True item.type = "video" return item
def CreatePageItem(self, resultSet): """ Accepts an resultset """ logFile.debug("Starting CreatePageItem") total = '' for set in resultSet: total = "%s%s" % (total,set) total = common.StripAmp(total) if not self.pageNavigationRegexIndex == '': item = common.clistItem(resultSet[self.pageNavigationRegexIndex], urlparse.urljoin(self.baseUrl, total)) else: item = common.clistItem("0") item.type = "page" logFile.debug("Created '%s' for url %s", item.name, item.url) return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s', self.channelName) # <li><a href="(/guide/season/[^"]+)">(\d+)</a></li> item = common.clistItem(resultSet[1], resultSet[0]) item.icon = self.icon item.complete = True return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ logFile.debug('starting CreateEpisodeItem for %s', self.channelName) # dummy class item = common.clistItem(resultSet[1], urlparse.urljoin(self.baseUrl, resultSet[0])) item.icon = self.icon item.complete = True return item
def CreatePageItem(self, resultSet): """ Accepts an resultset """ logFile.debug("Starting CreatePageItem") total = '' for set in resultSet: total = "%s%s" % (total, set) total = common.StripAmp(total) if not self.pageNavigationRegexIndex == '': item = common.clistItem(resultSet[self.pageNavigationRegexIndex], urlparse.urljoin(self.baseUrl, total)) else: item = common.clistItem("0") item.type = "page" logFile.debug("Created '%s' for url %s", item.name, item.url) return item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.debug('starting CreateEpisodeItem for %s', self.channelName) # dummy class _item = common.clistItem(resultSet[1], self.baseUrl + resultSet[0]) _item.icon = self.folderIcon _item.complete = True return _item
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) #<div class="enddep"><a\W+href="([^"]+)"[^>]+>([^<]+)</a></div> # 0 1 item = common.clistItem(resultSet[1], common.StripAmp(urlparse.urljoin(self.baseUrl, resultSet[0]))) item.description = "%s%s" % (self.categoryName, item.name) item.icon = self.icon logFile.debug("%s (%s)", item.name, item.url) return item
def ShowListItems(self, items): self.getControl(controls.PR_LIST).reset() if len(items) == 0: # add dummy item tmp = common.clistItem("No Files", "") tmp.complete = True items.append(tmp) for m in items: self.getControl(controls.PR_LIST).addItem( xbmcgui.ListItem(m.name, m.date, m.icon, m.icon))
def CreateEpisodeItem(self, resultSet): """ Accepts an arraylist of results. It returns an item. """ #logFile.info('starting CreateEpisodeItem for %s', self.channelName) #<a class='nArrow' href='([^']+)' title='[^']*'>([^<]+)</a> # 0 1 item = common.clistItem( resultSet[1], common.StripAmp("%s%s" % (self.baseUrl, resultSet[0]))) item.icon = self.icon logFile.debug("%s (%s)", item.name, item.url) return item
def CreateFolderItem(self, resultSet): # <div class="enddep"><a[^>]+href="([^"]+)"[^>]*>([^<]+)</a>\W*</div> # 0 1 # <td class="image"><a[^>]+><img[^>]+src="([^"]+)"[^>]+></a></td>\W+<td[^>]+><div[^>]+><div class="enddep"><a[^>]+href="([^"]+)"[^>]*>([^<]+)</a>\W*</div> # # 0 1 2 item = common.clistItem(resultSet[1], common.StripAmp(urlparse.urljoin(self.baseUrl, resultSet[0]))) item.description = "%s%s" % (self.categoryName, item.name) item.thumb = self.noImage item.type = "folder" item.complete = True item.icon = self.folderIcon return item
def SearchSite(self): """ accepts an url and returns an list with items of type CListItem Items have a name and url. """ items = [] #check for cookie: logFile.info("Checking for NOS cookies.") if uriHandler.CookieCheck('UGSES') and uriHandler.CookieCheck('CheckUGCookie'):# and uriHandler.CookieCheck('quuid'): logFile.info("Cookies found. Continuing") else: logFile.info("No cookies found. Opening main site") temp = uriHandler.Open(self.baseUrl) keyboard = xbmc.Keyboard('') keyboard.doModal() if (keyboard.isConfirmed()): needle = keyboard.getText() if len(needle)<4: dialog = xbmcgui.Dialog() dialog.ok("Uitzendinggemist","Geen geldig zoekopdracht. Een zoekopdracht\nheeft minimaal 4 characters.") return #get only first one logFile.info("Searching NOS for needle: "+needle) data = uriHandler.Open("http://www.uitzendinggemist.nl/index.php/search",params="searchitem=&qs_uitzending="+needle+"&titel=&dag=&net_zender=&omroep=&genre=") #resultSet = common.DoRegexFindAll('<a class="title" href="/index.php/search\?([^"]+)&sq=[^<]+">([^<]+)(<span[^>]+>)*([^<]+)(</span>)*</a></td>', data) resultSet = common.DoRegexFindAll('<a class="title" href="/index.php/search\?([^"]+)&sq=[^<]+">([^<]*)(<span[^>]+>)*([^<]*)(</span>)*([^<]*)</a></td>', data) for item in resultSet: logFile.debug(item) name = "" for part in item[1:]: if not part.find(">") > 0: name = "%s%s" % (name, part) tmp = common.clistItem(name, self.baseUrl + "/index.php/serie?" + common.StripAmp(item[0])) tmp.icon = self.folderIcon tmp.thumb = self.noImage tmp.description = name items.append(tmp) #because lists are downloaded according to date (else some programs will be missing), a sort on name is performed. items.sort(lambda x, y: cmp(x.name,y.name)) else: logFile.info('user canceled search') return items