Exemplo n.º 1
0
def LIST_EPISODES_DB():
    seriestitle = args.get('url')
    for asin in seriestitle.split(','):
        episodes = tv.loadTVEpisodesdb(asin)
        for episodedata in episodes:
            ADD_EPISODE_ITEM(episodedata)
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    SetView('episodes', 'episodeview')
Exemplo n.º 2
0
def LIST_EPISODES_DB(owned=False, url=False):
    if not url:
        seriestitle = common.args.url
    import tv as tvDB
    for asin in seriestitle.split(','):
        episodes = tvDB.loadTVEpisodesdb(asin)
        for episodedata in episodes:
            ADD_EPISODE_ITEM(episodedata)
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    common.SetView('episodes', 'episodeview')
Exemplo n.º 3
0
def LIST_EPISODES_DB(owned=False, url=False):
    if not url:
        seriestitle = common.args.url
    import tv as tvDB
    for asin in seriestitle.split(','):
        episodes = tvDB.loadTVEpisodesdb(asin)
        for episodedata in episodes:
            ADD_EPISODE_ITEM(episodedata)
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    common.SetView('episodes', 'episodeview')
def LIST_EPISODES_DB(seriestitle,season,poster,HDonly=False,path=False,NFO=True):
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle,season,HDonly)
    #asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched
    for asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched in episodes:
        episodetitle = episodetitle.replace(':','').replace('/',' ').replace('[HD]','').strip()
        if seriestitle in episodetitle:
            episodetitle = episodetitle.replace(seriestitle,'').strip().strip(',').strip('')
        if 'Season ' in episodetitle:
            episodetitle = episodetitle.replace('Season ','S')
        filename = 'S%sE%s - %s' % (season,episode,cleanfilename(episodetitle))
    	CreateStreamFile(filename, url, path)
        if NFO:
            soup = BeautifulStoneSoup()
            episodedetails = Tag(soup, "episodedetails")
            soup.insert(0, episodedetails)
            episodedetails.insert(0, createElement('title',episodetitle+' (Amazon)'))
            if season:
                episodedetails.insert(1, createElement('season',str(season)))
            if episode:
                episodedetails.insert(2, createElement('episode',str(episode)))
            if plot:
                episodedetails.insert(3, createElement('plot',plot))
            if airdate:
                episodedetails.insert(4, createElement('aired',airdate))
                episodedetails.insert(5, createElement('premiered',airdate))
            episodedetails.insert(6, createElement('thumb',poster))
   
            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'))
            if isHD:
                video.insert(1, createElement('height','720'))
                video.insert(2, createElement('width','1280'))
                video.insert(3, createElement('aspect','1.778'))
            else:
                video.insert(1, createElement('height','480'))
                video.insert(2, createElement('width','640'))
            video.insert(3, createElement('scantype','Progressive'))
            streamdetails.insert(1,video)
            fileinfo.insert(0,streamdetails)
            episodedetails.insert(7, fileinfo)
                
            episodeNFO = os.path.join(path,filename+'.nfo')
            file = open(episodeNFO, 'w')
            file.write(str(soup))
            file.close()
Exemplo n.º 5
0
def EXPORT_SEASON(asin=False):
    if not asin:
        asin=common.args.asin
    #SetupLibrary()
    seasons = tvDB.lookupSeasondb(asin)
    for asin,seriesASIN,episodeFeed,poster,season,seriestitle,plot,actors,network,mpaa,genres,premiered,year,stars,votes,episodetotal,watched,unwatched,isHD,isprime in seasons:
        directorname = os.path.join(TV_SHOWS_PATH,seriestitle.replace(':',''))
        CreateDirectory(directorname)
        name = 'Season '+str(season)
        if isHD:
            name+=' HD'
        seasonpath = os.path.join(directorname,name)
        CreateDirectory(seasonpath)
        episodes = tvDB.loadTVEpisodesdb(seriestitle,season,isHD)
        for episodedata in episodes:
            EXPORT_EPISODE(episodedata[0],isHD=isHD)
Exemplo n.º 6
0
def LIST_EPISODES_DB(HDonly=False,owned=False,url=False,export=False):
    if not url:
        url = common.args.url
    split = url.split('<split>')
    seriestitle = split[0]
    try:
        season = int(split[1])
    except:
        season = 0
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle,season,HDonly)
    for episodedata in episodes:
        ADD_EPISODE_ITEM(episodedata)
    #xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.setContent(pluginhandle, 'Episodes')
    xbmcplugin.endOfDirectory(pluginhandle,updateListing=False)
    viewenable=common.addon.getSetting("viewenable")
    if viewenable == 'true':
        view=int(common.addon.getSetting("episodeview"))
        xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[view])+")")  
def LIST_EPISODES_DB(HDonly=False,owned=False,url=False):
    if not url:
        url = common.args.url
    split = url.split('<split>')
    seriestitle = split[0]
    try:
        season = int(split[1])
    except:
        season = 0
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle,season,HDonly)
    #asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched
    for asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched in episodes:
        infoLabels={'Title': episodetitle,'TVShowTitle':seriestitle,
                    'Episode': episode,'Season':season}
        if plot:
            infoLabels['Plot'] = plot
        if airdate:
            infoLabels['Premiered'] = airdate 
        if runtime:
            infoLabels['Duration'] = runtime
        if season == 0: displayname =  str(episode)+'. '+episodetitle
        else: displayname =  str(season)+'x'+str(episode)+' - '+episodetitle

        if common.args.thumb: poster = common.args.thumb
        if common.args.fanart and common.args.fanart <>'': fanart = common.args.fanart
        else: fanart=poster

        cm = []
        if watched:
            infoLabels['overlay']=7
            cm.append( ('Unwatch', 'XBMC.RunPlugin(%s?mode="tv"&sitemode="unwatchEpisodedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) )
        else: cm.append( ('Mark Watched', 'XBMC.RunPlugin(%s?mode="tv"&sitemode="watchEpisodedb"&url="%s")' % ( sys.argv[0], urllib.quote_plus(asin) ) ) )
        common.addVideo(displayname,url,poster,fanart,infoLabels=infoLabels,cm=cm)
    #xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.setContent(pluginhandle, 'Episodes')
    viewenable=common.addon.getSetting("viewenable")
    if viewenable == 'true':
        view=int(common.addon.getSetting("episodeview"))
        xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[view])+")")  
    xbmcplugin.endOfDirectory(pluginhandle,updateListing=False)
Exemplo n.º 8
0
def LIST_EPISODES_DB(HDonly=False, owned=False, url=False, export=False):
    if not url:
        url = common.args.url
    split = url.split('<split>')
    seriestitle = split[0]
    try:
        season = int(split[1])
    except:
        season = 0
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle, season, HDonly)
    for episodedata in episodes:
        ADD_EPISODE_ITEM(episodedata)
    #xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.setContent(pluginhandle, 'Episodes')
    xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)
    viewenable = common.addon.getSetting("viewenable")
    if viewenable == 'true':
        view = int(common.addon.getSetting("episodeview"))
        xbmc.executebuiltin("Container.SetViewMode(" +
                            str(confluence_views[view]) + ")")
def LIST_EPISODES_DB(seriestitle,
                     season,
                     poster,
                     HDonly=False,
                     path=False,
                     NFO=True):
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle, season, HDonly)
    #asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched
    for asin, seriestitle, season, episode, episodetitle, url, plot, airdate, runtime, isHD, isprime, watched in episodes:
        episodetitle = episodetitle.replace(':', '').replace('/', ' ').replace(
            '[HD]', '').strip()
        if seriestitle in episodetitle:
            episodetitle = episodetitle.replace(
                seriestitle, '').strip().strip(',').strip('')
        if 'Season ' in episodetitle:
            episodetitle = episodetitle.replace('Season ', 'S')
        filename = 'S%sE%s - %s' % (season, episode,
                                    cleanfilename(episodetitle))
        CreateStreamFile(filename, url, path)
        if NFO:
            soup = BeautifulStoneSoup()
            episodedetails = Tag(soup, "episodedetails")
            soup.insert(0, episodedetails)
            episodedetails.insert(
                0, createElement('title', episodetitle + ' (Amazon)'))
            if season:
                episodedetails.insert(1, createElement('season', str(season)))
            if episode:
                episodedetails.insert(2, createElement('episode',
                                                       str(episode)))
            if plot:
                episodedetails.insert(3, createElement('plot', plot))
            if airdate:
                episodedetails.insert(4, createElement('aired', airdate))
                episodedetails.insert(5, createElement('premiered', airdate))
            episodedetails.insert(6, createElement('thumb', poster))

            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'))
            if isHD:
                video.insert(1, createElement('height', '720'))
                video.insert(2, createElement('width', '1280'))
                video.insert(3, createElement('aspect', '1.778'))
            else:
                video.insert(1, createElement('height', '480'))
                video.insert(2, createElement('width', '640'))
            video.insert(3, createElement('scantype', 'Progressive'))
            streamdetails.insert(1, video)
            fileinfo.insert(0, streamdetails)
            episodedetails.insert(7, fileinfo)

            episodeNFO = os.path.join(path, filename + '.nfo')
            file = open(episodeNFO, 'w')
            file.write(str(soup))
            file.close()
Exemplo n.º 10
0
def LIST_EPISODES_DB(HDonly=False, owned=False, url=False):
    if not url:
        url = common.args.url
    split = url.split('<split>')
    seriestitle = split[0]
    try:
        season = int(split[1])
    except:
        season = 0
    import tv as tvDB
    episodes = tvDB.loadTVEpisodesdb(seriestitle, season, HDonly)
    #asin,seriestitle,season,episode,episodetitle,url,plot,airdate,runtime,isHD,isprime,watched
    for asin, seriestitle, season, episode, episodetitle, url, plot, airdate, runtime, isHD, isprime, watched in episodes:
        infoLabels = {
            'Title': episodetitle,
            'TVShowTitle': seriestitle,
            'Episode': episode,
            'Season': season
        }
        if plot:
            infoLabels['Plot'] = plot
        if airdate:
            infoLabels['Premiered'] = airdate
        if runtime:
            infoLabels['Duration'] = runtime
        if season == 0: displayname = str(episode) + '. ' + episodetitle
        else:
            displayname = str(season) + 'x' + str(
                episode) + ' - ' + episodetitle

        if common.args.thumb: poster = common.args.thumb
        if common.args.fanart and common.args.fanart <> '':
            fanart = common.args.fanart
        else:
            fanart = poster

        cm = []
        if watched:
            infoLabels['overlay'] = 7
            cm.append((
                'Unwatch',
                'XBMC.RunPlugin(%s?mode="tv"&sitemode="unwatchEpisodedb"&url="%s")'
                % (sys.argv[0], urllib.quote_plus(asin))))
        else:
            cm.append((
                'Mark Watched',
                'XBMC.RunPlugin(%s?mode="tv"&sitemode="watchEpisodedb"&url="%s")'
                % (sys.argv[0], urllib.quote_plus(asin))))
        common.addVideo(displayname,
                        url,
                        poster,
                        fanart,
                        infoLabels=infoLabels,
                        cm=cm)
    #xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.setContent(pluginhandle, 'Episodes')
    viewenable = common.addon.getSetting("viewenable")
    if viewenable == 'true':
        view = int(common.addon.getSetting("episodeview"))
        xbmc.executebuiltin("Container.SetViewMode(" +
                            str(confluence_views[view]) + ")")
    xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)