Exemplo n.º 1
0
def show_playlists_by_channel(Channelid, type=''):
    search_response = ytube.yt_get_channel_info(Channelid)
    
    #Grab the playlists from the response
    playlists = search_response['items'][0]['contentDetails']['relatedPlaylists']
    
    # Go through each playlist and display the playlist
    for key, value in playlists.iteritems():
      #Grab the number of videos to
      pl = ytube.yt_get_playlist_info(value)
      number_vids = str(pl['items'][0]['contentDetails']['itemCount'])
      #videos.append(search_result)
      url = dev.build_url({'mode': 'addPlaylist', 'id': value, 'type': type})
      dev.adddir(key.capitalize()+' ('+number_vids+')', url, search_response['items'][0]['snippet']['thumbnails']['high']['url'], fanart=search_response['items'][0]['snippet']['thumbnails']['high']['url'], description=dev.lang(31010)+' '+dev.typeName(type)+' \n--------\nPlaylist Description:\n'+search_response['items'][0]['snippet']['description'])
    
    # Grab other playlists this user has created to
    response = ytube.yt_get_playlists_by_channel(Channelid)
    
    if isinstance(response, list):
        # Go through each playlist and display the playlist
        for playlist in response:
          #videos.append(search_result)
          title = playlist['snippet']['title']+' ('+str(playlist['contentDetails']['itemCount'])+')'
          url = dev.build_url({'mode': 'addPlaylist', 'id': playlist['id'], 'type': type})
          dev.adddir(title, url, playlist['snippet']['thumbnails']['high']['url'], fanart=playlist['snippet']['thumbnails']['high']['url'], description=dev.lang(31010)+' '+dev.typeName(type)+' \n--------\nPlaylist Description:\n'+playlist['snippet']['description'])
    xbmcplugin.endOfDirectory(vars.addon_handle)#Adds a playlist & loads the view to edit it
def refresh_artwork(id, type=''):
    response = ytube.yt_get_playlist_info(id)
    res = response['items'][0]['snippet']
    
    thumbnail = dev.best_thumbnail(res)
    #Grab the channel information 
    response = ytube.yt_get_channel_info(res['channelId'])
    snippet = response['items'][0]['snippet']
    brand = response['items'][0]['brandingSettings']
    
    #Check if we can do a better thumbnail
    better_thumbnail = dev.best_thumbnail(snippet)
    if(better_thumbnail != False):
        thumbnail = better_thumbnail
    if thumbnail == False:
        thumbnail = ''
        
    dev.log('The thumbnail now: '+thumbnail)
    
    bannerTv = brand['image']['bannerImageUrl']
    if 'bannerTvImageUrl' in brand['image']:
        bannerTv = brand['image']['bannerTvImageUrl']
    
    m_xml.xml_update_playlist_setting(id, 'thumb', thumbnail, type=type) #Save the new setting
    m_xml.xml_update_playlist_setting(id, 'banner', brand['image']['bannerImageUrl'], type=type) #Save the new setting
    m_xml.xml_update_playlist_setting(id, 'fanart', bannerTv, type=type) #Save the new setting
    
    settings = m_xml.xml_get_elem('playlists/playlist', 'playlist', {'id': id}, type=type) #Grab the xml settings for this playlist

    id = vars.args['id'][0]
    update_playlist(id, type=type)
def refresh_artwork(id, type=''):
    response = ytube.yt_get_playlist_info(id)
    res = response['items'][0]['snippet']
    
    thumbnail = dev.best_thumbnail(res)
    #Grab the channel information 
    response = ytube.yt_get_channel_info(res['channelId'])
    snippet = response['items'][0]['snippet']
    brand = response['items'][0]['brandingSettings']
    
    #Check if we can do a better thumbnail
    better_thumbnail = dev.best_thumbnail(snippet)
    if(better_thumbnail != False):
        thumbnail = better_thumbnail
    if thumbnail == False:
        thumbnail = ''
        
    dev.log('The thumbnail now: '+thumbnail)
    
    bannerTv = brand['image']['bannerImageUrl']
    if 'bannerTvImageUrl' in brand['image']:
        bannerTv = brand['image']['bannerTvImageUrl']
    
    m_xml.xml_update_playlist_setting(id, 'thumb', thumbnail, type=type) #Save the new setting
    m_xml.xml_update_playlist_setting(id, 'banner', brand['image']['bannerImageUrl'], type=type) #Save the new setting
    m_xml.xml_update_playlist_setting(id, 'fanart', bannerTv, type=type) #Save the new setting
    
    settings = m_xml.xml_get_elem('playlists/playlist', 'playlist', {'id': id}, type=type) #Grab the xml settings for this playlist

    id = vars.args['id'][0]
    update_playlist(id, type=type)
def show_playlists_by_channel(Channelid, type='', pagetoken='default'):
    if pagetoken == 'default' or pagetoken == '':
        search_response = ytube.yt_get_channel_info(Channelid)
        
        #Grab the playlists from the response
        playlists = search_response['items'][0]['contentDetails']['relatedPlaylists']
        
        # Go through each playlist and display the playlist
        for key, value in playlists.iteritems():
          if value == 'WL' or value == 'HL':
             continue #The watch later and watch history playlists are not giving their normal id's, so skip them
          #Grab the number of videos to
          pl = ytube.yt_get_playlist_info(value)
          number_vids = str(pl['items'][0]['contentDetails']['itemCount'])
          #videos.append(search_result)
          url = dev.build_url({'mode': 'addPlaylist', 'id': value, 'type': type})
          dev.adddir(key.capitalize()+' ('+number_vids+')', url,  dev.playlist_highest_thumbnail(search_response['items'][0]), fanart=dev.playlist_highest_thumbnail(search_response['items'][0]), description=dev.lang(31010)+' '+dev.typeName(type)+' \n--------\nPlaylist Description:\n'+search_response['items'][0]['snippet']['description'])
    
    # Grab other playlists this user has created to
    response = ytube.yt_get_playlists_by_channel(Channelid, pagetoken)
    
    
    if isinstance(response['items'], list):
        # Go through each playlist and display the playlist
        for playlist in response['items']:
          #videos.append(search_result)
          title = playlist['snippet']['title']+' ('+str(playlist['contentDetails']['itemCount'])+')'
          url = dev.build_url({'mode': 'addPlaylist', 'id': playlist['id'], 'type': type})
          dev.adddir(title, url, dev.playlist_highest_thumbnail(playlist), fanart= dev.playlist_highest_thumbnail(playlist), description=dev.lang(31010)+' '+dev.typeName(type)+' \n--------\nPlaylist Description:\n'+playlist['snippet']['description'])
    
    
    if 'prevPageToken' in response:
        if response['prevPageToken'] is not None:
            url = dev.build_url({'mode': 'pickedChannel', 'id': Channelid, 'type': type, 'pagetoken': response['prevPageToken']})
            dev.adddir('<< Prev Page', url, description='Go to the previous page of available playlists')
    
    if 'nextPageToken' in response:
        if response['nextPageToken'] is not None:
            url = dev.build_url({'mode': 'pickedChannel', 'id': Channelid, 'type': type, 'pagetoken': response['nextPageToken']})
            dev.adddir('Next Page >>', url, description='Go to the next page of available playlists')

    
    xbmcplugin.endOfDirectory(vars.addon_handle)#Adds a playlist & loads the view to edit it
def show_playlists_by_channel(Channelid, type='', pagetoken='default'):
    if pagetoken == 'default' or pagetoken == '':
        search_response = ytube.yt_get_channel_info(Channelid)

        #Grab the playlists from the response
        playlists = search_response['items'][0]['contentDetails'][
            'relatedPlaylists']

        # Go through each playlist and display the playlist
        for key, value in playlists.iteritems():
            if value == 'WL' or value == 'HL':
                continue  #The watch later and watch history playlists are not giving their normal id's, so skip them
            #Grab the number of videos to
            pl = ytube.yt_get_playlist_info(value)
            number_vids = str(pl['items'][0]['contentDetails']['itemCount'])
            #videos.append(search_result)
            url = dev.build_url({
                'mode': 'addPlaylist',
                'id': value,
                'type': type
            })
            dev.adddir(key.capitalize() + ' (' + number_vids + ')',
                       url,
                       dev.playlist_highest_thumbnail(
                           search_response['items'][0]),
                       fanart=dev.playlist_highest_thumbnail(
                           search_response['items'][0]),
                       description=dev.lang(31010) + ' ' + dev.typeName(type) +
                       ' \n--------\nPlaylist Description:\n' +
                       search_response['items'][0]['snippet']['description'])

    # Grab other playlists this user has created to
    response = ytube.yt_get_playlists_by_channel(Channelid, pagetoken)

    if isinstance(response['items'], list):
        # Go through each playlist and display the playlist
        for playlist in response['items']:
            #videos.append(search_result)
            title = playlist['snippet']['title'] + ' (' + str(
                playlist['contentDetails']['itemCount']) + ')'
            url = dev.build_url({
                'mode': 'addPlaylist',
                'id': playlist['id'],
                'type': type
            })
            dev.adddir(title,
                       url,
                       dev.playlist_highest_thumbnail(playlist),
                       fanart=dev.playlist_highest_thumbnail(playlist),
                       description=dev.lang(31010) + ' ' + dev.typeName(type) +
                       ' \n--------\nPlaylist Description:\n' +
                       playlist['snippet']['description'])

    if 'prevPageToken' in response:
        if response['prevPageToken'] is not None:
            url = dev.build_url({
                'mode': 'pickedChannel',
                'id': Channelid,
                'type': type,
                'pagetoken': response['prevPageToken']
            })
            dev.adddir(
                '<< Prev Page',
                url,
                description='Go to the previous page of available playlists')

    if 'nextPageToken' in response:
        if response['nextPageToken'] is not None:
            url = dev.build_url({
                'mode': 'pickedChannel',
                'id': Channelid,
                'type': type,
                'pagetoken': response['nextPageToken']
            })
            dev.adddir(
                'Next Page >>',
                url,
                description='Go to the next page of available playlists')

    xbmcplugin.endOfDirectory(
        vars.addon_handle)  #Adds a playlist & loads the view to edit it
def xml_build_new_playlist(id, type=''):
    response = ytube.yt_get_playlist_info(id)
    #Save relevant information in res
    res = response['items'][0]['snippet']
    #channelid = res['channelId']
    
    thumbnail = False
    #If this playlist has a thumbnail, use the best possible thumbnail for this playlist
    if 'thumbnails' in res:
        #if 'maxres' in res['thumbnails']:
        #    thumbnail = res['thumbnails']['maxres']
        if 'standard' in res['thumbnails']:
            thumbnail = res['thumbnails']['standard']['url']
        elif 'high' in res['thumbnails']:
            thumbnail = res['thumbnails']['high']['url']
        elif 'medium' in res['thumbnails']:
            thumbnail = res['thumbnails']['medium']['url']
        elif 'default' in res['thumbnails']:
            thumbnail = res['thumbnails']['default']['url']
        dev.log('The thumbnail: '+thumbnail)
        
    #Grab the channel information 
    response = ytube.yt_get_channel_info(res['channelId'])
    snippet = response['items'][0]['snippet']
    brand = response['items'][0]['brandingSettings']
    #Check if we should do a better thumbnail
    #if thumbnail is False:
    if 'thumbnails' in snippet:
        #if 'maxres' in snippet['thumbnails']:
        #    thumbnail = snippet['thumbnails']['maxres']
        if 'standard' in snippet['thumbnails']:
            thumbnail = snippet['thumbnails']['standard']['url']
        elif 'high' in snippet['thumbnails']:
            thumbnail = snippet['thumbnails']['high']['url']
        elif 'medium' in snippet['thumbnails']:
            thumbnail = snippet['thumbnails']['medium']['url']
        elif 'default' in snippet['thumbnails']:
            thumbnail = snippet['thumbnails']['default']['url']
    if thumbnail is False:
        thumbnail = ''
    dev.log('The thumbnail now: '+thumbnail)
    #Check what the better description is
    if len(res['description']) > 0:
        description = res['description']
    else:
        description = snippet['description']
        
    #Check what the best title is
    if res['title'] == 'Uploads from '+snippet['title']:
        #Set title to just the channelname
        title = snippet['title']
    else:
        #Prefix the playlistname with the channelname
        title = snippet['title']+' - '+res['title']
    
    bannerTv = brand['image']['bannerImageUrl']
    if 'bannerTvImageUrl' in brand['image']:
        bannerTv = brand['image']['bannerTvImageUrl']


    #### Build new playlist (tv, musicvideo) ###
    if type=='' or type=='tv':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_genre", '')
        tags = dev.getAddonSetting("default_tags", 'Youtube')
        season = dev.getAddonSetting("default_season", 'year')
        episode = dev.getAddonSetting("default_episode", 'default')
        minlength = dev.getAddonSetting("default_minlength", '')
        maxlength = dev.getAddonSetting("default_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_excludewords", '')
        stripdescription = dev.getAddonSetting("default_stripdescription", '')
        removedescription = dev.getAddonSetting("default_removedescription", '')
        striptitle = dev.getAddonSetting("default_striptitle", '')
        removetitle = dev.getAddonSetting("default_removetitle", '')
        updateevery = dev.getAddonSetting("default_updateevery", 'every 12 hours')
        updateat = dev.getAddonSetting("default_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_update_gmt", '99')
        
        
        #Build the playlist
        playlist = {
            'id'    : id,
            'enabled'      : 'no',
            'settings'      : {
                'type'                  : 'TV',
                'title'                   : title,
                'channel'            : snippet['title'],
                'channelId' : res['channelId'],
                'description'        : description,
                'genre'                : genre,
                'tags'                  : tags,
                'published'          : snippet['publishedAt'],
                #Art
                'thumb'               : thumbnail,
                'fanart'                : bannerTv,
                'banner'              : brand['image']['bannerImageUrl'],
                'epsownfanart'    : 'No',
                # STRM & NFO Settings
                'writenfo'             : writenfo,
                'delete'                : '',
                'updateevery'       : updateevery,
                'updateat'        : updateat,
                'update_gmt'        : update_gmt,
                'onlygrab'          : dev.getAddonSetting("default_onlygrab", ''),
                'keepvideos'        : '',
                'overwritefolder'   : '',
                #Filters
                'minlength'         : minlength,
                'maxlength'         : maxlength,
                'excludewords'    : excludewords,
                'onlyinclude'       : onlyinclude,
                #NFO information
                'season'            : season,
                'episode'           : episode,
                'striptitle'            : striptitle,
                'removetitle'       : removetitle,
                'stripdescription' : stripdescription,
                'removedescription' : removedescription,
                #Scan Settings
                'lastvideoId'       : '',
                'reverse'           : '0',
            }
        }
        return playlist
    elif type=='movies':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_movies_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_movies_genre", '')
        tags = dev.getAddonSetting("default_movies_tags", 'Youtube')
        search_imdb = dev.getAddonSetting("default_movies_search_imdb", '2')
        imdb_match_cutoff = dev.getAddonSetting("default_movies_imdb_match_cutoff", '0.75')
        use_ytimage = dev.getAddonSetting("default_movies_use_ytimage", '0')
        minlength = dev.getAddonSetting("default_movies_minlength", '')
        maxlength = dev.getAddonSetting("default_movies_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_movies_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_movies_excludewords", '')
        stripdescription = dev.getAddonSetting("default_movies_stripdescription", '')
        removedescription = dev.getAddonSetting("default_movies_removedescription", '')
        striptitle = dev.getAddonSetting("default_movies_striptitle", '')
        removetitle = dev.getAddonSetting("default_movies_removetitle", '')
        updateevery = dev.getAddonSetting("default_movies_updateevery", 'every 12 hours')
        updateat = dev.getAddonSetting("default_movies_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_movies_update_gmt", '99')
        set = dev.getAddonSetting("default_movies_set", '')
        smart_search = dev.getAddonSetting("default_movies_smart_search", '1')
        
        
        #Build the playlist
        playlist = {
            'id'    : id,
            'enabled'      : 'no',
            'settings'      : {
                'type'                  : 'movies',
                'title'                   : title,
                'channel'            : snippet['title'],
                'channelId' : res['channelId'],
                'description'        : description,
                'genre'                : genre,
                'tags'                  : tags,
                'set'                   : set,
                'published'          : snippet['publishedAt'],
                #Art
                'thumb'               : thumbnail,
                'fanart'                : bannerTv,
                'banner'              : brand['image']['bannerImageUrl'],
                'epsownfanart'    : 'No',
                # STRM & NFO Settings
                'writenfo'             : writenfo,
                'delete'                : '',
                'updateevery'       : updateevery,
                'updateat'        : updateat,
                'update_gmt'        : update_gmt,
                'onlygrab'          : dev.getAddonSetting("default_movies_onlygrab", ''),
                'keepvideos'        : '',
                'overwritefolder'   : '',
                #Filters
                'minlength'         : minlength,
                'maxlength'         : maxlength,
                'excludewords'    : excludewords,
                'onlyinclude'       : onlyinclude,
                #NFO information
                'search_imdb'            : search_imdb,
                'imdb_match_cutoff'           : imdb_match_cutoff,
                'use_ytimage'           : use_ytimage,
                'smart_search'          : smart_search,
                'striptitle'            : striptitle,
                'removetitle'       : removetitle,
                'stripdescription' : stripdescription,
                'removedescription' : removedescription,
                #Scan Settings
                'lastvideoId'       : '',
                'reverse'           : ''
            }
        }
        return playlist
    if type=='musicvideo':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_musicvideo_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_musicvideo_genre", '')
        genre_fallback = dev.getAddonSetting("default_musicvideo_genre_fallback", '')
        genre_hardcoded = dev.getAddonSetting("default_musicvideo_genre_hardcoded", '')
        
        artist = dev.getAddonSetting("default_musicvideo_artist", '')
        artist_fallback = dev.getAddonSetting("default_musicvideo_artist_fallback", '')
        artist_hardcoded = dev.getAddonSetting("default_musicvideo_artist_hardcoded", '')
        
        song_fallback = dev.getAddonSetting("default_musicvideo_song_fallback", '')
        
        album = dev.getAddonSetting("default_musicvideo_album", '')
        album_fallback = dev.getAddonSetting("default_musicvideo_album_fallback", '')
        album_hardcoded = dev.getAddonSetting("default_musicvideo_album_hardcoded", '')
        
        plot = dev.getAddonSetting("default_musicvideo_plot", '')
        plot_fallback = dev.getAddonSetting("default_musicvideo_plot_fallback", '')
        plot_hardcoded = dev.getAddonSetting("default_musicvideo_plot_hardcoded", '')
        
        year = dev.getAddonSetting("default_musicvideo_year", '')
        year_fallback = dev.getAddonSetting("default_musicvideo_year_fallback", '')
        year_hardcoded = dev.getAddonSetting("default_musicvideo_year_hardcoded", '')
        
        tags = dev.getAddonSetting("default_musicvideo_tags", 'Youtube')
        minlength = dev.getAddonSetting("default_musicvideo_minlength", '')
        maxlength = dev.getAddonSetting("default_musicvideo_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_musicvideo_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_musicvideo_excludewords", '')
        stripdescription = dev.getAddonSetting("default_musicvideo_stripdescription", '')
        removedescription = dev.getAddonSetting("default_musicvideo_removedescription", '')
        striptitle = dev.getAddonSetting("default_musicvideo_striptitle", '')
        removetitle = dev.getAddonSetting("default_musicvideo_removetitle", '')
        updateevery = dev.getAddonSetting("default_musicvideo_updateevery", 'every 12 hours')
        updateat = dev.getAddonSetting("default_musicvideo_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_musicvideo_update_gmt", '99')
        
        #Build the playlist
        playlist = {
            'id'    : id,
            'enabled'      : 'no',
            'settings'      : {
                'type'                  : 'MusicVideo',
                'title'                   : title,
                'channel'            : snippet['title'],
                'channelId' : res['channelId'],
                'description'        : description,
                'published'          : snippet['publishedAt'],
                #Library Info
                'tags'                  : tags,
                'genre'                : genre,
                'genre_fallback'        : genre_fallback,
                'genre_hardcoded'       : genre_hardcoded,
                'artist'                : artist,
                'artist_fallback'       : artist_fallback,
                'artist_hardcoded'       : artist_hardcoded,
                'song_fallback'         : song_fallback,
                'album'                 : album,
                'album_fallback'        : album_fallback,
                'album_hardcoded'       : album_hardcoded,
                'plot'                  : plot,
                'plot_fallback'         : plot_fallback,
                'plot_hardcoded'        : plot_hardcoded,
                'year'                  : year,
                'year_fallback'         : year_fallback,
                'year_hardcoded'        : year_hardcoded,
                #Art
                'thumb'               : thumbnail,
                'fanart'                : bannerTv,
                'banner'              : brand['image']['bannerImageUrl'],
                # STRM & NFO Settings
                'writenfo'             : writenfo,
                'updateevery'       : updateevery,
                'updateat'        : updateat,
                'update_gmt'        : update_gmt,
                'onlygrab'          : dev.getAddonSetting("default_musicvideo_onlygrab", ''),
                'delete'                : '',
                'keepvideos'        : '',
                'overwritefolder'   : '',
                #Filters
                'minlength'         : minlength,
                'maxlength'         : maxlength,
                'excludewords'    : excludewords,
                'onlyinclude'       : onlyinclude,
                #Skip
                'skip_audio'   : dev.getAddonSetting("default_musicvideo_skip_audio", 'false'),
                'skip_lyrics'   : dev.getAddonSetting("default_musicvideo_skip_lyrics", 'false'),
                'skip_live'     : dev.getAddonSetting("default_musicvideo_skip_live", 'false'),
                'skip_albums'   : dev.getAddonSetting("default_musicvideo_skip_albums", 'false'),
                #NFO information
                'striptitle'            : striptitle,
                'removetitle'       : removetitle,
                'stripdescription' : stripdescription,
                'removedescription' : removedescription,
                #Scan Settings
                'lastvideoId'       : '',
                'reverse'           : '',
            }
        }
        return playlist
    return False
def xml_build_new_playlist(id, type=''):
    response = ytube.yt_get_playlist_info(id)
    res = response['items'][0]['snippet']

    thumbnail = dev.best_thumbnail(res)
    #Grab the channel information
    response = ytube.yt_get_channel_info(res['channelId'])
    snippet = response['items'][0]['snippet']
    brand = response['items'][0]['brandingSettings']

    #Check if we can do a better thumbnail
    better_thumbnail = dev.best_thumbnail(snippet)
    if (better_thumbnail != False):
        thumbnail = better_thumbnail
    if thumbnail == False:
        thumbnail = ''

    dev.log('The thumbnail now: ' + thumbnail)

    #Check what the better description is
    if len(res['description']) > 0:
        description = res['description']
    else:
        description = snippet['description']

    #Check what the best title is
    if res['title'] == 'Uploads from ' + snippet['title']:
        #Set title to just the channelname
        title = snippet['title']
    else:
        #Prefix the playlistname with the channelname
        title = snippet['title'] + ' - ' + res['title']

    bannerTv = brand['image']['bannerImageUrl']
    if 'bannerTvImageUrl' in brand['image']:
        bannerTv = brand['image']['bannerTvImageUrl']

    #### Build new playlist (tv, musicvideo) ###
    if type == '' or type == 'tv':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_genre", '')
        tags = dev.getAddonSetting("default_tags", 'Youtube')
        season = dev.getAddonSetting("default_season", 'year')
        episode = dev.getAddonSetting("default_episode", 'default')
        minlength = dev.getAddonSetting("default_minlength", '')
        maxlength = dev.getAddonSetting("default_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_excludewords", '')
        stripdescription = dev.getAddonSetting("default_stripdescription", '')
        removedescription = dev.getAddonSetting("default_removedescription",
                                                '')
        striptitle = dev.getAddonSetting("default_striptitle", '')
        removetitle = dev.getAddonSetting("default_removetitle", '')
        updateevery = dev.getAddonSetting("default_updateevery",
                                          'every 12 hours')
        updateat = dev.getAddonSetting("default_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_update_gmt", '99')
        download_videos = dev.getAddonSetting("default_download_videos", '0')

        #Build the playlist
        playlist = {
            'id': id,
            'enabled': 'no',
            'settings': {
                'type': 'TV',
                'title': title,
                'channel': snippet['title'],
                'channelId': res['channelId'],
                'description': description,
                'genre': genre,
                'tags': tags,
                'published': snippet['publishedAt'],
                #Art
                'thumb': thumbnail,
                'fanart': bannerTv,
                'banner': brand['image']['bannerImageUrl'],
                'epsownfanart': 'No',
                # STRM & NFO Settings
                'writenfo': writenfo,
                'delete': '',
                'updateevery': updateevery,
                'updateat': updateat,
                'update_gmt': update_gmt,
                'onlygrab': dev.getAddonSetting("default_onlygrab", ''),
                'keepvideos': '',
                'overwritefolder': '',
                #Filters
                'minlength': minlength,
                'maxlength': maxlength,
                'excludewords': excludewords,
                'onlyinclude': onlyinclude,
                #NFO information
                'season': season,
                'episode': episode,
                'striptitle': striptitle,
                'removetitle': removetitle,
                'stripdescription': stripdescription,
                'removedescription': removedescription,
                #Scan Settings
                'lastvideoId': '',
                'reverse': '0',
                'download_videos': download_videos,
            }
        }
        return playlist
    elif type == 'movies':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_movies_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_movies_genre", '')
        tags = dev.getAddonSetting("default_movies_tags", 'Youtube')
        search_imdb = dev.getAddonSetting("default_movies_search_imdb", '2')
        imdb_match_cutoff = dev.getAddonSetting(
            "default_movies_imdb_match_cutoff", '0.75')
        use_ytimage = dev.getAddonSetting("default_movies_use_ytimage", '0')
        minlength = dev.getAddonSetting("default_movies_minlength", '')
        maxlength = dev.getAddonSetting("default_movies_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_movies_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_movies_excludewords", '')
        stripdescription = dev.getAddonSetting(
            "default_movies_stripdescription", '')
        removedescription = dev.getAddonSetting(
            "default_movies_removedescription", '')
        striptitle = dev.getAddonSetting("default_movies_striptitle", '')
        removetitle = dev.getAddonSetting("default_movies_removetitle", '')
        updateevery = dev.getAddonSetting("default_movies_updateevery",
                                          'every 12 hours')
        updateat = dev.getAddonSetting("default_movies_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_movies_update_gmt", '99')
        set = dev.getAddonSetting("default_movies_set", '')
        smart_search = dev.getAddonSetting("default_movies_smart_search", '1')
        download_videos = dev.getAddonSetting("default_movies_download_videos",
                                              '0')

        #Build the playlist
        playlist = {
            'id': id,
            'enabled': 'no',
            'settings': {
                'type': 'movies',
                'title': title,
                'channel': snippet['title'],
                'channelId': res['channelId'],
                'description': description,
                'genre': genre,
                'tags': tags,
                'set': set,
                'published': snippet['publishedAt'],
                #Art
                'thumb': thumbnail,
                'fanart': bannerTv,
                'banner': brand['image']['bannerImageUrl'],
                'epsownfanart': 'No',
                # STRM & NFO Settings
                'writenfo': writenfo,
                'delete': '',
                'updateevery': updateevery,
                'updateat': updateat,
                'update_gmt': update_gmt,
                'onlygrab': dev.getAddonSetting("default_movies_onlygrab", ''),
                'keepvideos': '',
                'overwritefolder': '',
                #Filters
                'minlength': minlength,
                'maxlength': maxlength,
                'excludewords': excludewords,
                'onlyinclude': onlyinclude,
                #NFO information
                'search_imdb': search_imdb,
                'imdb_match_cutoff': imdb_match_cutoff,
                'use_ytimage': use_ytimage,
                'smart_search': smart_search,
                'striptitle': striptitle,
                'removetitle': removetitle,
                'stripdescription': stripdescription,
                'removedescription': removedescription,
                #Scan Settings
                'lastvideoId': '',
                'reverse': '',
                'download_videos': download_videos,
            }
        }
        return playlist
    if type == 'musicvideo':
        ##Get the default settings from the addon settings
        writenfo = 'Yes'
        if dev.getAddonSetting("default_musicvideo_generate_nfo") == "false":
            writenfo = 'no'
        genre = dev.getAddonSetting("default_musicvideo_genre", '')
        genre_fallback = dev.getAddonSetting(
            "default_musicvideo_genre_fallback", '')
        genre_hardcoded = dev.getAddonSetting(
            "default_musicvideo_genre_hardcoded", '')

        artist = dev.getAddonSetting("default_musicvideo_artist", '')
        artist_fallback = dev.getAddonSetting(
            "default_musicvideo_artist_fallback", '')
        artist_hardcoded = dev.getAddonSetting(
            "default_musicvideo_artist_hardcoded", '')

        song_fallback = dev.getAddonSetting("default_musicvideo_song_fallback",
                                            '')

        album = dev.getAddonSetting("default_musicvideo_album", '')
        album_fallback = dev.getAddonSetting(
            "default_musicvideo_album_fallback", '')
        album_hardcoded = dev.getAddonSetting(
            "default_musicvideo_album_hardcoded", '')

        plot = dev.getAddonSetting("default_musicvideo_plot", '')
        plot_fallback = dev.getAddonSetting("default_musicvideo_plot_fallback",
                                            '')
        plot_hardcoded = dev.getAddonSetting(
            "default_musicvideo_plot_hardcoded", '')

        year = dev.getAddonSetting("default_musicvideo_year", '')
        year_fallback = dev.getAddonSetting("default_musicvideo_year_fallback",
                                            '')
        year_hardcoded = dev.getAddonSetting(
            "default_musicvideo_year_hardcoded", '')

        tags = dev.getAddonSetting("default_musicvideo_tags", 'Youtube')
        minlength = dev.getAddonSetting("default_musicvideo_minlength", '')
        maxlength = dev.getAddonSetting("default_musicvideo_maxlength", '')
        onlyinclude = dev.getAddonSetting("default_musicvideo_onlyinclude", '')
        excludewords = dev.getAddonSetting("default_musicvideo_excludewords",
                                           '')
        stripdescription = dev.getAddonSetting(
            "default_musicvideo_stripdescription", '')
        removedescription = dev.getAddonSetting(
            "default_musicvideo_removedescription", '')
        striptitle = dev.getAddonSetting("default_musicvideo_striptitle", '')
        removetitle = dev.getAddonSetting("default_musicvideo_removetitle", '')
        updateevery = dev.getAddonSetting("default_musicvideo_updateevery",
                                          'every 12 hours')
        updateat = dev.getAddonSetting("default_musicvideo_updateat", '23:59')
        update_gmt = dev.getAddonSetting("default_musicvideo_update_gmt", '99')
        download_videos = dev.getAddonSetting("default_download_videos", '0')

        #Build the playlist
        playlist = {
            'id': id,
            'enabled': 'no',
            'settings': {
                'type':
                'MusicVideo',
                'title':
                title,
                'channel':
                snippet['title'],
                'channelId':
                res['channelId'],
                'description':
                description,
                'published':
                snippet['publishedAt'],
                #Library Info
                'tags':
                tags,
                'genre':
                genre,
                'genre_fallback':
                genre_fallback,
                'genre_hardcoded':
                genre_hardcoded,
                'artist':
                artist,
                'artist_fallback':
                artist_fallback,
                'artist_hardcoded':
                artist_hardcoded,
                'song_fallback':
                song_fallback,
                'album':
                album,
                'album_fallback':
                album_fallback,
                'album_hardcoded':
                album_hardcoded,
                'plot':
                plot,
                'plot_fallback':
                plot_fallback,
                'plot_hardcoded':
                plot_hardcoded,
                'year':
                year,
                'year_fallback':
                year_fallback,
                'year_hardcoded':
                year_hardcoded,
                #Art
                'thumb':
                thumbnail,
                'fanart':
                bannerTv,
                'banner':
                brand['image']['bannerImageUrl'],
                # STRM & NFO Settings
                'writenfo':
                writenfo,
                'updateevery':
                updateevery,
                'updateat':
                updateat,
                'update_gmt':
                update_gmt,
                'onlygrab':
                dev.getAddonSetting("default_musicvideo_onlygrab", ''),
                'delete':
                '',
                'keepvideos':
                '',
                'overwritefolder':
                '',
                #Filters
                'minlength':
                minlength,
                'maxlength':
                maxlength,
                'excludewords':
                excludewords,
                'onlyinclude':
                onlyinclude,
                #Skip
                'skip_audio':
                dev.getAddonSetting("default_musicvideo_skip_audio", 'false'),
                'skip_lyrics':
                dev.getAddonSetting("default_musicvideo_skip_lyrics", 'false'),
                'skip_live':
                dev.getAddonSetting("default_musicvideo_skip_live", 'false'),
                'skip_albums':
                dev.getAddonSetting("default_musicvideo_skip_albums", 'false'),
                #NFO information
                'striptitle':
                striptitle,
                'removetitle':
                removetitle,
                'stripdescription':
                stripdescription,
                'removedescription':
                removedescription,
                #Scan Settings
                'lastvideoId':
                '',
                'reverse':
                '',
                'download_videos':
                download_videos,
            }
        }
        return playlist
    return False