def record_download_archive(track):
    """
    Write the track_id in the download archive
    """
    global arguments
    if not arguments['--download-archive']:
        return

    archive_filename = arguments.get('--download-archive')
    try:
        with open(archive_filename, 'a', encoding='utf-8') as file:
            file.write('{0}'.format(track['id'])+'\n')
    except IOError as ioe:
        logger.error('Error trying to write to download archive...')
        logger.debug(ioe)
def record_download_archive ( track ) : global arguments if not arguments [ '--download-archive' ] : return archive_filename = arguments . get ( '--download-archive' ) try : with open ( archive_filename , 'a' , encoding = 'utf-8' ) as file : file . write ( '{0}' . format ( track [ 'id' ] ) + '\n' ) except IOError as ioe : logger . error ( 'Error trying to write to download archive...' ) logger . debug ( ioe )
Write the track_id in the download archive