def LIST_MOVIES(filter='', value=False, sortcol=False, sortaz=True, search=False, cmmode=0, export=False): import movies as moviesDB if 'year' in filter: value = value.replace('0 -', '') movies = moviesDB.loadMoviedb(filter=filter, value=value, sortcol=sortcol) count = 0 for moviedata in movies: count += 1 ADD_MOVIE_ITEM(moviedata, cmmode=cmmode, export=export) if not search: if sortaz: if not 'year' in filter: xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) common.SetView('movies', 'movieview') return count
def LIST_MOVIES(genrefilter=False,actorfilter=False,directorfilter=False,studiofilter=False,yearfilter=False,mpaafilter=False,watchedfilter=False,favorfilter=False,alphafilter=False): xbmcplugin.setContent(pluginhandle, 'Movies') editenable=common.addon.getSetting("editenable") import movies as moviesDB movies = moviesDB.loadMoviedb(genrefilter=genrefilter,actorfilter=actorfilter,directorfilter=directorfilter,studiofilter=studiofilter,yearfilter=yearfilter,mpaafilter=mpaafilter,watchedfilter=watchedfilter,favorfilter=favorfilter,alphafilter=alphafilter) for asin,movietitle,url,poster,plot,director,writer,runtime,year,premiered,studio,mpaa,actors,genres,stars,votes,TMDBbanner,TMDBposter,TMDBfanart,isprime,watched,favor,TMDB_ID in movies: fanart = poster.replace('.jpg','._BO354,0,0,0_CR177,354,708,500_.jpg') infoLabels={'Title':movietitle} if plot: infoLabels['Plot'] = plot if actors: infoLabels['Cast'] = actors.split(',') if director: infoLabels['Director'] = director if year: infoLabels['Year'] = year if premiered: infoLabels['Premiered'] = premiered if stars: infoLabels['Rating'] = stars if votes: infoLabels['Votes'] = votes if genres: infoLabels['Genre'] = genres if mpaa: infoLabels['mpaa'] = mpaa if studio: infoLabels['Studio'] = studio if runtime: infoLabels['Duration'] = runtime cm = [] if watched: infoLabels['overlay']=7 cm.append( ('Unwatch', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="unwatchMoviedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) ) else: cm.append( ('Mark Watched', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="watchMoviedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) ) if favor: cm.append( ('Remove from Favorites', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="unfavorMoviedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) ) else: cm.append( ('Add to Favorites', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="favorMoviedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) ) if editenable == 'true': cm.append( ('Remove from Movies', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="deleteMoviedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) ) common.addVideo(movietitle,url,poster,fanart,infoLabels=infoLabels,cm=cm) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) viewenable=common.addon.getSetting("viewenable") if viewenable == 'true': view=int(common.addon.getSetting("movieview")) xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[view])+")") xbmcplugin.endOfDirectory(pluginhandle,updateListing=False)
def LIST_MOVIES(export=False, genrefilter=False, actorfilter=False, directorfilter=False, studiofilter=False, yearfilter=False, mpaafilter=False, watchedfilter=False, favorfilter=False, alphafilter=False): if export: xbmclibrary.SetupLibrary() import movies as moviesDB movies = moviesDB.loadMoviedb(genrefilter=genrefilter, actorfilter=actorfilter, directorfilter=directorfilter, studiofilter=studiofilter, yearfilter=yearfilter, mpaafilter=mpaafilter, watchedfilter=watchedfilter, favorfilter=favorfilter, alphafilter=alphafilter) for moviedata in movies: if export: xbmclibrary.EXPORT_MOVIE(moviedata[0]) else: ADD_MOVIE_ITEM(moviedata) if not export: xbmcplugin.setContent(pluginhandle, 'Movies') xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) viewenable = common.addon.getSetting("viewenable") if viewenable == 'true': view = int(common.addon.getSetting("movieview")) xbmc.executebuiltin("Container.SetViewMode(" + str(confluence_views[view]) + ")") xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)
def LIST_MOVIES(filter=False,value=False,sortcol=False,sortaz=True,search=False,cmmode=0,export=False): import movies as moviesDB movies = moviesDB.loadMoviedb(filter=filter,value=value,sortcol=sortcol) count = 0 for moviedata in movies: count += 1 ADD_MOVIE_ITEM(moviedata, cmmode=cmmode, export=export) if not search: if sortaz: xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) common.SetView('movies', 'movieview') return count
def LIST_MOVIES(filter='', value=False, sortcol=False, sortaz=True, search=False, cmmode=0): import movies as moviesDB if 'year' in filter: value = value.replace('0 -', '') movies = moviesDB.loadMoviedb(movie_filter=filter, value=value, sortcol=sortcol) count = 0 for moviedata in movies: count += 1 ADD_MOVIE_ITEM(moviedata, cmmode=cmmode) if not search: if sortaz: if 'year' not in filter: xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(common.pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) common.SetView('movies') return count
def LIST_MOVIES(export=False,genrefilter=False,actorfilter=False,directorfilter=False,studiofilter=False,yearfilter=False,mpaafilter=False,watchedfilter=False,favorfilter=False,alphafilter=False): if export: xbmclibrary.SetupLibrary() import movies as moviesDB movies = moviesDB.loadMoviedb(genrefilter=genrefilter,actorfilter=actorfilter,directorfilter=directorfilter,studiofilter=studiofilter,yearfilter=yearfilter,mpaafilter=mpaafilter,watchedfilter=watchedfilter,favorfilter=favorfilter,alphafilter=alphafilter) for moviedata in movies: if export: xbmclibrary.EXPORT_MOVIE(moviedata[0]) else: ADD_MOVIE_ITEM(moviedata) if not export: xbmcplugin.setContent(pluginhandle, 'Movies') xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) viewenable=common.addon.getSetting("viewenable") if viewenable == 'true': view=int(common.addon.getSetting("movieview")) xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[view])+")") xbmcplugin.endOfDirectory(pluginhandle,updateListing=False)
def LIST_MOVIES(): if (common.addon.getSetting('enablelibraryfolder') == 'true'): SetupAmazonLibrary() elif (common.addon.getSetting('customlibraryfolder') <> ''): CreateDirectory(MOVIE_PATH) CreateDirectory(TV_SHOWS_PATH) import movies as moviesDB movies = moviesDB.loadMoviedb(favorfilter=True) for asin, movietitle, url, poster, plot, director, writer, runtime, year, premiered, studio, mpaa, actors, genres, stars, votes, TMDBbanner, TMDBposter, TMDBfanart, isprime, watched, favor, TMDB_ID in movies: CreateStreamFile(movietitle, url, MOVIE_PATH) soup = BeautifulSoup() movie = Tag(soup, "movie") soup.insert(0, movie) movie.insert(0, createElement('title', movietitle + ' (Amazon)')) if year: movie.insert(1, createElement('year', str(year))) if premiered: movie.insert(1, createElement('premiered', premiered)) if plot: movie.insert(2, createElement('plot', plot)) if runtime: movie.insert(2, createElement('runtime', runtime)) if votes: movie.insert(3, createElement('votes', str(votes))) if stars: movie.insert(4, createElement('rating', str(stars))) if director: movie.insert(5, createElement('director', director)) if studio: movie.insert(6, createElement('studio', studio)) if poster: movie.insert(7, createElement('thumb', poster)) if mpaa: movie.insert(8, createElement('mpaa', mpaa)) u = sys.argv[0] u += '?url="' + urllib.quote_plus(url) + '"' u += '&mode="play"' u += '&name="' + urllib.quote_plus(movietitle) + '"' utrailer = u + '&sitemode="PLAYTRAILER"' movie.insert(9, createElement('trailer', utrailer)) fileinfo = createElement('fileinfo', '') streamdetails = createElement('streamdetails', '') audio = createElement('audio', '') audio.insert(0, createElement('channels', '2')) audio.insert(1, createElement('codec', 'aac')) streamdetails.insert(0, audio) video = createElement('video', '') video.insert(0, createElement('codec', 'h264')) video.insert(1, createElement('height', '400')) video.insert(2, createElement('width', '720')) video.insert(4, createElement('scantype', 'Progressive')) streamdetails.insert(1, video) fileinfo.insert(0, streamdetails) movie.insert(10, fileinfo) index = 10 if genres: for genre in genres.split(','): index += 1 movie.insert(index, createElement('genre', genre)) if actors: for actor in actors.split(','): if actor <> None: index += 1 actortag = createElement('actor', '') actorname = createElement('name', actor) actortag.insert(0, actorname) movie.insert(index, actortag) movieNFO = os.path.join(MOVIE_PATH, movietitle + '.nfo') file = open(movieNFO, 'w') file.write(str(soup)) file.close()
def LIST_MOVIES(): if (common.addon.getSetting('enablelibraryfolder') == 'true'): SetupAmazonLibrary() elif (common.addon.getSetting('customlibraryfolder') <> ''): CreateDirectory(MOVIE_PATH) CreateDirectory(TV_SHOWS_PATH) import movies as moviesDB movies = moviesDB.loadMoviedb(favorfilter=True) for asin,movietitle,url,poster,plot,director,writer,runtime,year,premiered,studio,mpaa,actors,genres,stars,votes,TMDBbanner,TMDBposter,TMDBfanart,isprime,watched,favor,TMDB_ID in movies: CreateStreamFile(movietitle, url, MOVIE_PATH) soup = BeautifulSoup() movie = Tag(soup, "movie") soup.insert(0, movie) movie.insert(0, createElement('title',movietitle+' (Amazon)')) if year: movie.insert(1, createElement('year',str(year))) if premiered: movie.insert(1, createElement('premiered',premiered)) if plot: movie.insert(2, createElement('plot',plot)) if runtime: movie.insert(2, createElement('runtime',runtime)) if votes: movie.insert(3, createElement('votes',str(votes))) if stars: movie.insert(4, createElement('rating',str(stars))) if director: movie.insert(5, createElement('director',director)) if studio: movie.insert(6, createElement('studio',studio)) if poster: movie.insert(7, createElement('thumb',poster)) if mpaa: movie.insert(8, createElement('mpaa',mpaa)) u = sys.argv[0] u += '?url="'+urllib.quote_plus(url)+'"' u += '&mode="play"' u += '&name="'+urllib.quote_plus(movietitle)+'"' utrailer = u+'&sitemode="PLAYTRAILER"' movie.insert(9, createElement('trailer',utrailer)) fileinfo = createElement('fileinfo','') streamdetails = createElement('streamdetails','') audio = createElement('audio','') audio.insert(0, createElement('channels','2')) audio.insert(1, createElement('codec','aac')) streamdetails.insert(0,audio) video = createElement('video','') video.insert(0, createElement('codec','h264')) video.insert(1, createElement('height','400')) video.insert(2, createElement('width','720')) video.insert(4, createElement('scantype','Progressive')) streamdetails.insert(1,video) fileinfo.insert(0,streamdetails) movie.insert(10, fileinfo) index = 10 if genres: for genre in genres.split(','): index += 1 movie.insert(index, createElement('genre',genre)) if actors: for actor in actors.split(','): if actor <> None: index += 1 actortag = createElement('actor','') actorname = createElement('name',actor) actortag.insert(0,actorname) movie.insert(index, actortag ) movieNFO = os.path.join(MOVIE_PATH,movietitle+'.nfo') file = open(movieNFO, 'w') file.write(str(soup)) file.close()
def LIST_MOVIES(genrefilter=False, actorfilter=False, directorfilter=False, studiofilter=False, yearfilter=False, mpaafilter=False, watchedfilter=False, favorfilter=False, alphafilter=False): xbmcplugin.setContent(pluginhandle, 'Movies') editenable = common.addon.getSetting("editenable") import movies as moviesDB movies = moviesDB.loadMoviedb(genrefilter=genrefilter, actorfilter=actorfilter, directorfilter=directorfilter, studiofilter=studiofilter, yearfilter=yearfilter, mpaafilter=mpaafilter, watchedfilter=watchedfilter, favorfilter=favorfilter, alphafilter=alphafilter) for asin, movietitle, url, poster, plot, director, writer, runtime, year, premiered, studio, mpaa, actors, genres, stars, votes, TMDBbanner, TMDBposter, TMDBfanart, isprime, watched, favor, TMDB_ID in movies: fanart = poster.replace('.jpg', '._BO354,0,0,0_CR177,354,708,500_.jpg') infoLabels = {'Title': movietitle} if plot: infoLabels['Plot'] = plot if actors: infoLabels['Cast'] = actors.split(',') if director: infoLabels['Director'] = director if year: infoLabels['Year'] = year if premiered: infoLabels['Premiered'] = premiered if stars: infoLabels['Rating'] = stars if votes: infoLabels['Votes'] = votes if genres: infoLabels['Genre'] = genres if mpaa: infoLabels['mpaa'] = mpaa if studio: infoLabels['Studio'] = studio if runtime: infoLabels['Duration'] = runtime cm = [] if watched: infoLabels['overlay'] = 7 cm.append(( 'Unwatch', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="unwatchMoviedb"&url="%s")' % (sys.argv[0], urllib.quote_plus(asin)))) else: cm.append(( 'Mark Watched', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="watchMoviedb"&url="%s")' % (sys.argv[0], urllib.quote_plus(asin)))) if favor: cm.append(( 'Remove from Favorites', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="unfavorMoviedb"&url="%s")' % (sys.argv[0], urllib.quote_plus(asin)))) else: cm.append(( 'Add to Favorites', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="favorMoviedb"&url="%s")' % (sys.argv[0], urllib.quote_plus(asin)))) if editenable == 'true': cm.append(( 'Remove from Movies', 'XBMC.RunPlugin(%s?mode="movies"&sitemode="deleteMoviedb"&url="%s")' % (sys.argv[0], urllib.quote_plus(asin)))) common.addVideo(movietitle, url, poster, fanart, infoLabels=infoLabels, cm=cm) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DURATION) xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE) viewenable = common.addon.getSetting("viewenable") if viewenable == 'true': view = int(common.addon.getSetting("movieview")) xbmc.executebuiltin("Container.SetViewMode(" + str(confluence_views[view]) + ")") xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)