andrade-soulseek-downloader
Version:
Simple, safe Soulseek download library with built-in rate limiting to prevent bans
31 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.soulseekDownload = soulseekDownload;
const api_handler_1 = require("../api-handler");
/**
* Simple API function for downloading tracks.
* @param artist - Artist name
* @param title - Track title
* @param folderName - Optional subfolder name within SOULSEEK_DOWNLOAD_DIR
* @param customFileName - Optional custom filename (without extension)
* @returns Path to downloaded file or null if failed
*
* @example
* ```typescript
* import { soulseekDownload } from 'andrader-soulseek-downloader';
*
* // Basic usage
* const filePath = await soulseekDownload('Daft Punk', 'One More Time');
*
* // With custom folder
* const filePath2 = await soulseekDownload('Daft Punk', 'One More Time', 'Electronic');
*
* // With custom folder and filename
* const filePath3 = await soulseekDownload('Daft Punk', 'One More Time', 'Electronic', 'daft_punk_one_more_time');
* ```
*/
async function soulseekDownload(artist, title, folderName, customFileName) {
const handler = api_handler_1.APIHandler.getInstance();
return handler.download(artist, title, folderName, customFileName);
}
//# sourceMappingURL=soulseek-download.js.map