def add_tvshow(): import xbmcplugin from resources.lib.scraper import getEpisodes ok = True for ep in getEpisodes(): # listitem = xbmcgui.ListItem(ep["title"], "", "DefaultTVShows.png", ep["icon"]) # listitem.setProperty("id", ep["id"]) listitem.setProperty("url", ep["url"]) listitem.setProperty("subtitle", ep["subtitle"]) listitem.setProperty("playpath", ep["playpath"]) listitem.setProperty("fanart_image", FANART2) # infoLabels = { "tvshowtitle": "Au pays des Têtes à claques", "season": 1, "year": 2012, "title": ep["title"], "plot": ep["plot"], "episode": int(ep["episode"]), "Aired": ep["aired"], "rating": ep["rate"], "duration": "23", } infoLabels.update(b_infoLabels) listitem.setInfo("Video", infoLabels) if hasattr(listitem, "addStreamInfo"): listitem.addStreamInfo('audio', { 'Codec': 'aac', 'language': 'fr', 'channels': 2 }) listitem.addStreamInfo('video', { 'Codec': 'h264', 'Width': 1230, 'height': 680 }) listitem.addStreamInfo('subtitle', {'language': 'fr'}) url = '%s?playpath="true"' % (sys.argv[0]) # add ContextMenuitems c_items = [("Play with Subtitle", 'RunPlugin(%s)' % url), ("Visit Episode", 'RunPlugin(%s?webbrowser="%s")' % (sys.argv[0], ep["url"])) ] listitem.addContextMenuItems(c_items) # url = ep["playpath"] ok = xbmcplugin.addDirectoryItem(int(sys.argv[1]), url, listitem, False) xbmcplugin.setContent(int(sys.argv[1]), "episodes") xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED) xbmcplugin.endOfDirectory(int(sys.argv[1]), ok)
def add_container(): import xbmcplugin from resources.lib.scraper import getEpisodes, S01_AIRED ok = True count = 0 for ep in getEpisodes( ADDON.getSetting("getplot") == "true", ADDON.getSetting("full") == "true"): # listitem = xbmcgui.ListItem(ep["title"], "", "DefaultTVShows.png", ep["icon"]) # listitem.setProperty("id", ep["id"]) listitem.setProperty("url", ep["url"]) listitem.setProperty("srt_url", ep["srt_url"]) listitem.setProperty("hd_url", ep["hd_url"]) listitem.setProperty("sd_url", ep["sd_url"]) listitem.setProperty("fanart_image", FANART) # infoLabels = { "title": ep["title"], "plot": ep["plot"], "episode": int(ep["episode"]), "Aired": ep["aired"], #"rating": ep[ "rate" ], "duration": "23", } infoLabels.update(b_infoLabels) listitem.setInfo("Video", infoLabels) # if ep["hd_url"] or ep["sd_url"]: url = (ep["hd_url"], ep["sd_url"])[int(ADDON.getSetting("quality"))] else: url = '%s?ID="%s"' % (sys.argv[0], ep["id"]) ok = xbmcplugin.addDirectoryItem(int(sys.argv[1]), url, listitem, False) count += 1 # try: icon = "http://tetesaclaques.tv/public/images/serie_tele_preview_QC.jpg" listitem = xbmcgui.ListItem("Épisode %i disponible le %s" % (count + 1, S01_AIRED[count])) listitem.setThumbnailImage(icon) listitem.setProperty("fanart_image", icon) url = '%s?webbrowser=1' % (sys.argv[0]) ok = xbmcplugin.addDirectoryItem(int(sys.argv[1]), url, listitem, False) except: pass xbmcplugin.setContent(int(sys.argv[1]), "episodes") xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED) xbmcplugin.endOfDirectory(int(sys.argv[1]), ok)
def add_container(): import xbmcplugin from resources.lib.scraper import getEpisodes, S01_AIRED ok = True count = 0 for ep in getEpisodes( ADDON.getSetting( "getplot" ) == "true", ADDON.getSetting( "full" ) == "true" ): # listitem = xbmcgui.ListItem( ep[ "title" ], "", "DefaultTVShows.png", ep[ "icon" ] ) # listitem.setProperty( "id", ep[ "id" ] ) listitem.setProperty( "url", ep[ "url" ] ) listitem.setProperty( "srt_url", ep[ "srt_url" ] ) listitem.setProperty( "hd_url", ep[ "hd_url" ] ) listitem.setProperty( "sd_url", ep[ "sd_url" ] ) listitem.setProperty( "fanart_image", FANART ) # infoLabels = { "title": ep[ "title" ], "plot": ep[ "plot" ], "episode": int( ep[ "episode" ] ), "Aired": ep[ "aired" ], #"rating": ep[ "rate" ], "duration": "23", } infoLabels.update( b_infoLabels ) listitem.setInfo( "Video", infoLabels ) # if ep[ "hd_url" ] or ep[ "sd_url" ]: url = ( ep[ "hd_url" ], ep[ "sd_url" ] )[ int( ADDON.getSetting( "quality" ) ) ] else: url = '%s?ID="%s"' % ( sys.argv[ 0 ], ep[ "id" ] ) ok = xbmcplugin.addDirectoryItem( int( sys.argv[ 1 ] ), url, listitem, False ) count += 1 # try: icon = "http://tetesaclaques.tv/public/images/serie_tele_preview_QC.jpg" listitem = xbmcgui.ListItem( "Épisode %i disponible le %s" % ( count+1, S01_AIRED[ count ] ) ) listitem.setThumbnailImage( icon ) listitem.setProperty( "fanart_image", icon ) url = '%s?webbrowser=1' % ( sys.argv[ 0 ] ) ok = xbmcplugin.addDirectoryItem( int( sys.argv[ 1 ] ), url, listitem, False ) except: pass xbmcplugin.setContent( int( sys.argv[ 1 ] ), "episodes" ) xbmcplugin.addSortMethod( int( sys.argv[ 1 ] ), xbmcplugin.SORT_METHOD_UNSORTED ) xbmcplugin.endOfDirectory( int( sys.argv[ 1 ] ), ok )
def add_tvshow(): import xbmcplugin from resources.lib.scraper import getEpisodes ok = True for ep in getEpisodes(): # listitem = xbmcgui.ListItem( ep[ "title" ], "", "DefaultTVShows.png", ep[ "icon" ] ) # listitem.setProperty( "id", ep[ "id" ] ) listitem.setProperty( "url", ep[ "url" ] ) listitem.setProperty( "subtitle", ep[ "subtitle" ] ) listitem.setProperty( "playpath", ep[ "playpath" ] ) listitem.setProperty( "fanart_image", FANART2 ) # infoLabels = { "tvshowtitle": "Au pays des Têtes à claques", "season": 1, "year": 2012, "title": ep[ "title" ], "plot": ep[ "plot" ], "episode": int( ep[ "episode" ] ), "Aired": ep[ "aired" ], "rating": ep[ "rate" ], "duration": "23", } infoLabels.update( b_infoLabels ) listitem.setInfo( "Video", infoLabels ) if hasattr( listitem, "addStreamInfo" ): listitem.addStreamInfo( 'audio', { 'Codec': 'aac', 'language': 'fr', 'channels': 2 } ) listitem.addStreamInfo( 'video', { 'Codec': 'h264', 'Width': 1230, 'height': 680 } ) listitem.addStreamInfo( 'subtitle', { 'language': 'fr' } ) url = '%s?playpath="true"' % ( sys.argv[ 0 ] ) # add ContextMenuitems c_items = [ ( "Play with Subtitle", 'RunPlugin(%s)' % url ), ( "Visit Episode", 'RunPlugin(%s?webbrowser="%s")' % ( sys.argv[ 0 ], ep[ "url" ] ) ) ] listitem.addContextMenuItems( c_items ) # url = ep[ "playpath" ] ok = xbmcplugin.addDirectoryItem( int( sys.argv[ 1 ] ), url, listitem, False ) xbmcplugin.setContent( int( sys.argv[ 1 ] ), "episodes" ) xbmcplugin.addSortMethod( int( sys.argv[ 1 ] ), xbmcplugin.SORT_METHOD_UNSORTED ) xbmcplugin.endOfDirectory( int( sys.argv[ 1 ] ), ok )