예제 #1
0
def WATCHLIST_LIST_MOVIES(export=False):
    if export:
        xbmclibrary.SetupLibrary()
    url = 'https://www.amazon.com/gp/video/watchlist/movie?show=all&sort=DATE_ADDED'
    data = common.getURL(url, useCookie=True)
    scripts = re.compile(r'<script.*?script>', re.DOTALL)
    data = scripts.sub('', data)
    style = re.compile(r'<style.*?style>', re.DOTALL)
    data = style.sub('', data)
    tree = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    videos = tree.findAll('div', attrs={'class': 'innerItem', 'id': True})
    totalItems = len(videos)
    for video in videos:
        asin = video['id']
        if export:
            xbmclibrary.EXPORT_MOVIE(asin)
        else:
            appfeed.ADD_MOVIE(asin, isPrime=True, inWatchlist=True)
    if not export:
        xbmcplugin.setContent(int(sys.argv[1]), 'Movies')
        xbmcplugin.endOfDirectory(pluginhandle)
        viewenable = common.addon.getSetting("viewenable")
        if viewenable == 'true':
            view = int(common.addon.getSetting("movieview"))
            xbmc.executebuiltin("Container.SetViewMode(" +
                                str(confluence_views[view]) + ")")
예제 #2
0
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)
예제 #3
0
def LIST_TVSHOWS(export=False,
                 HDonly=False,
                 mpaafilter=False,
                 genrefilter=False,
                 creatorfilter=False,
                 networkfilter=False,
                 yearfilter=False,
                 favorfilter=False):
    if export:
        xbmclibrary.SetupLibrary()
    import tv as tvDB
    shows = tvDB.loadTVShowdb(HDonly=HDonly,
                              mpaafilter=mpaafilter,
                              genrefilter=genrefilter,
                              creatorfilter=creatorfilter,
                              networkfilter=networkfilter,
                              yearfilter=yearfilter,
                              favorfilter=favorfilter)
    for showdata in shows:
        if export:
            xbmclibrary.EXPORT_SHOW(showdata[0])
        else:
            ADD_SHOW_ITEM(showdata, HDonly=HDonly)
    if not export:
        xbmcplugin.setContent(pluginhandle, 'tvshows')
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_VIDEO_RATING)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE)
        xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)
        viewenable = common.addon.getSetting("viewenable")
        if viewenable == 'true':
            view = int(common.addon.getSetting("showview"))
            xbmc.executebuiltin("Container.SetViewMode(" +
                                str(confluence_views[view]) + ")")