{"id":13907752,"url":"https://github.com/zackradisic/node-soundcloud-downloader","last_synced_at":"2025-04-05T21:07:52.508Z","repository":{"id":38290704,"uuid":"267213900","full_name":"zackradisic/node-soundcloud-downloader","owner":"zackradisic","description":"A SoundCloud API v2 wrapper for Node.js","archived":false,"fork":false,"pushed_at":"2023-01-24T22:05:59.000Z","size":1845,"stargazers_count":135,"open_issues_count":24,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T20:05:03.353Z","etag":null,"topics":["soundcloud","soundcloud-api","soundcloud-downloader","soundcloud-music-downloader","soundcloud-stream"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zackradisic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T03:44:06.000Z","updated_at":"2025-01-19T11:29:29.000Z","dependencies_parsed_at":"2023-02-14T02:00:53.375Z","dependency_job_id":null,"html_url":"https://github.com/zackradisic/node-soundcloud-downloader","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Fnode-soundcloud-downloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Fnode-soundcloud-downloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Fnode-soundcloud-downloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackradisic%2Fnode-soundcloud-downloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackradisic","download_url":"https://codeload.github.com/zackradisic/node-soundcloud-downloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399877,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["soundcloud","soundcloud-api","soundcloud-downloader","soundcloud-music-downloader","soundcloud-stream"],"created_at":"2024-08-06T23:02:08.863Z","updated_at":"2025-04-05T21:07:52.491Z","avatar_url":"https://github.com/zackradisic.png","language":"TypeScript","funding_links":[],"categories":["HarmonyOS","TypeScript"],"sub_categories":["Windows Manager"],"readme":"![node-soundcloud-downloader](https://socialify.git.ci/zackradisic/node-soundcloud-downloader/image?font=Raleway\u0026language=1\u0026owner=1\u0026stargazers=1\u0026theme=Dark)\n\n\n[![Zack Radisic](https://img.shields.io/badge/Author-Zack%20Radisic-green)](https://github.com/zackradisic)\n[![downloads](https://img.shields.io/npm/dt/soundcloud-downloader)](https://www.npmjs.com/package/soundcloud-downloader)\n![Node.js CI](https://github.com/zackradisic/node-soundcloud-downloader/workflows/Node.js%20CI/badge.svg)\n\n\nDownload Soundcloud tracks with Node.js\n```\nnpm install soundcloud-downloader\n```\n\nI couldn't find any packages that worked with a Discord bot I was working on so I created my own.\n\n#### Features\n- Extremely fast (interacts directly with the Soundcloud API)\n- Download/manipulate audio from Soundcloud (it is returned as a [stream](https://nodejs.org/api/stream.html))\n- Get information about [tracks](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#getinfo) and [playlists](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#getsetinfo)\n- [Filter](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#filtermedia) and [download](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#downloadformat) specific formats\n- [Search](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#search) and find [related](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#related) tracks/playlists/albums/users\n\n#### Table of Contents\n- [API](#api)\n- [Examples](#examples)\n- [Obtaining a Client ID](#client-id)\n- [To do](#to-do)\n\n## API / [Documentation](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html)\nHere are the two most commonly used functions:\n### [scdl.download(url, clientID?)](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#download)\n- Gets the audio from the given URL, returns a [ReadableStream](https://nodejs.org/api/stream.html#stream_class_stream_readable).\n\n### [scdl.getInfo(url, clientID?)](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html#getinfo)\n- Returns a JSON object containing the track's information, as well as media links.\n\nRead the [docs](https://zackradisic.github.io/node-soundcloud-downloader/classes/_index_.scdl.html) for more.\n\n## Examples\nThe easiest way to get Soundcloud audio is with the `scdl.download(url: string)` function, which returns a Promise containing a ReadableStream.\n```javascript\nconst scdl = require('soundcloud-downloader').default\nconst fs = require('fs')\n\nconst SOUNDCLOUD_URL = 'https://soundcloud.com/askdjfhaklshf'\nconst CLIENT_ID = 'asdhkalshdkhsf'\n\nscdl.download(SOUNDCLOUD_URL).then(stream =\u003e stream.pipe(fs.createWriteStream('audio.mp3')))\n```\n\nYou can do anything you like with the stream that is returned, an example with [Discord.js](https://github.com/discordjs/discord.js/):\n```javascript\nconst client = new Discord.Client()\nconst url = 'https://soundcloud.com/taliya-jenkins/double-cheese-burger-hold-the'\nconst clientID = 'asdlkajasd'\nconst channelID = '123456789'\nclient.on('ready', () =\u003e {\n  const channel = client.channels.cache.get(channelID)\n  channel.join().then(connection =\u003e {\n    scdl.download(url, clientID).then(stream =\u003e {\n      connection.play(stream)\n    })\n  })\n})\n```\n\nYou can also create a custom instance of the SCDL class with settings configured to your liking:\n```javascript\nconst scdlCreate = require('../').create\nconst axios = require('axios').default\n\nconst scdl = scdlCreate({\n  clientID: 'adasdasd',\n  saveClientID: true,\n  filePath: './client_id.json',\n  axiosInstance: axios.create()\n})\n```\n\nYou can view the code for these examples and find more in the [example](example) folder.\n\n\n## Client ID\nYou can obtain a Client ID by visting the Soundcloud website and inspecting network traffic (perhaps with Chrome DevTools or some HTTP proxy software) and looking for any requests to the Soundcloud API. Ex:\n```\nhttps://api-v2.soundcloud.com/me/play-history/tracks?client_id={CLIENT ID IS HERE}\u0026limit=25\u0026offset=0\u0026linked_partitioning=1\u0026app_version=1590494738\u0026app_locale=en\n```\n\nHere is a picture of where you should be able to find it:\n![](img/clientid.png)\n\n## To-do\nIf I have the time and there is enough demand, I am interested in implementing the following functionalities:\n- Audio format selection ✅\n- Ability to use HTTP Live Streaming (HLS) ✅\n- Some more integrations with Discord.js like selecting best format for voice channels\n\nIf you have any feature requests, suggestions or questions do not hesistate to post them in the issues section\n\n## Disclaimer\nI do not support piracy and this package is not designed for circumventing the technological measures employed\nby SoundCloud preventing unauthorized access to copyrighted works. This package is only for downloading\naudio you have access to.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackradisic%2Fnode-soundcloud-downloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackradisic%2Fnode-soundcloud-downloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackradisic%2Fnode-soundcloud-downloader/lists"}