def show_videos_init(self): ok = True cpt = 0 file = xbmc.makeLegalFilename(os.path.join(self.CACHEDIR,self.FILENAME)) f = open(file,'w') pDialog = xbmcgui.DialogProgress() ret = pDialog.create( 'XBMC', __language__ ( 30200 ) ) pDialog.update(0, __language__ ( 30202 ) ) catalog = Catalog() self.NB_VIDEO = catalog.videos.__len__(); for video in catalog.videos: f.write('\n'.join(['%s;%s;%s;%s' % (video[Catalog.TITLE_TAG].encode('utf-8'),video[Catalog.DATE_TAG].encode('utf-8'), video[Catalog.URL_TAG].encode('utf-8'), video[Catalog.IMAGE_TAG].encode('utf-8'))])) cpt=cpt+1 paramsAddons = {} paramsAddons[self.PARAM_PLAY_VIDEO] = "true" paramsAddons[self.PARAM_VIDEO_ID] = video[Catalog.URL_TAG] url = _create_param_url( paramsAddons ) infoLabels={ "Title": video[Catalog.DATE_TAG] + " - " + video[Catalog.TITLE_TAG], "Date": video[Catalog.DATE_TAG]} paramsAddonsContextMenu = {} paramsAddonsContextMenu[self.PARAM_DOWNLOAD_VIDEO] = "true" paramsAddonsContextMenu[self.PARAM_VIDEO_ID] = video[Catalog.URL_TAG] paramsAddonsContextMenu[self.PARAM_VIDEO_NAME] = video[Catalog.TITLE_TAG] urlContextMenu = _create_param_url( paramsAddonsContextMenu ) cm = _addContextMenuItems(name=video[Catalog.TITLE_TAG], url=urlContextMenu, msg= __language__(30102)) _addLink( name=video[Catalog.TITLE_TAG], url=url, iconimage=video[Catalog.IMAGE_TAG], itemInfoLabels=infoLabels, c_items=cm ) pDialog.update(int(99*float(cpt)/(self.NB_VIDEO)), __language__ ( 30202 ) ) pDialog.close() f.close() xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE) xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category="referer" ) xbmcplugin.setContent(int(sys.argv[1]), 'movies') _end_of_directory( True ) return ok
def show_videos(self): """ rempli la liste avec la liste des videos """ ok = True cpt = 0 file = xbmc.makeLegalFilename(os.path.join(self.CACHEDIR,self.FILENAME)) f = open(file,"r") pDialog = xbmcgui.DialogProgress() ret = pDialog.create( 'XBMC', __language__ ( 30200 ) ) pDialog.update(0, __language__ ( 30202 ) ) for line in f: video = line.split(";") cpt=cpt+1 paramsAddons = {} paramsAddons[self.PARAM_PLAY_VIDEO] = "true" paramsAddons[self.PARAM_VIDEO_ID] = video[2] url = _create_param_url( paramsAddons ) infoLabels={ "Title": video[1] + " - " + video[0], "Date": video[1]} _addLink( name=video[0], url=url, iconimage=video[3], itemInfoLabels=infoLabels ) paramsAddons = {} paramsAddons[self.PARAM_DOWNLOAD_VIDEO] = "true" paramsAddons[self.PARAM_VIDEO_ID] = video[2] url = _create_param_url( paramsAddons ) _addContextMenuItems(video[1],url, __language__(30102)) pDialog.update(int(99*float(cpt)/(self.NB_VIDEO)), __language__ ( 30202 ) ) pDialog.close() f.close() xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE) xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category="referer" ) xbmcplugin.setContent(int(sys.argv[1]), 'movies') _end_of_directory( True ) return ok
"Genre": strip_html(genre), "Studio": "", "Country": country, "Director": video.author, "Duration": video.duration, "Cast": "", "Date": video.date } c_items = self.createVideoContextMenu(video) paramsAddons = self.createParamsAddons(self.PARAM_PLAY_VIDEO, video) url = _create_param_url(paramsAddons) _addLink(name=name, url=url, iconimage=video.pix, itemInfoLabels=infoLabels, c_items=c_items) def retrieveVideoLink(self, link): hd = None if isinstance(self.PARSER, LiveParser): links = self.PARSER.get_links(link) if links['Live'] is not None: #hd = links['Live'] hd = None elif links['HD'] is not None and self.is_HD: hd = links['HD']
"Plot": strip_html( summary ), "PlotOutline": strip_html( video.pitch.encode('utf-8') ), "MPAA": "", "Genre": strip_html( genre ), "Studio": "", "Country":country, "Director": video.author, "Duration": video.duration, "Cast": "", "Date": video.date } c_items = self.createVideoContextMenu( video ) paramsAddons = self.createParamsAddons( self.PARAM_PLAY_VIDEO, video ) url = _create_param_url( paramsAddons ) _addLink( name = name, url = url, iconimage = video.pix, itemInfoLabels = infoLabels, c_items = c_items ) def retrieveVideoLink( self, link ): hd = None if isinstance( self.PARSER, LiveParser ) : links = self.PARSER.get_links( link ) if links[ 'Live' ] is not None: #hd = links['Live'] hd = None elif links[ 'HD' ] is not None and self.is_HD: hd = links[ 'HD' ] else :