Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- nama : soundcloud track downloader
- base : https://soundcloud.com
- by : wolep
- update : 30 november 2025 1 PM
- node : v24.11.1
- note : idk, enjoy
- module : esm (tested) / cjs (gak tau coba test yah :v)
- */
- const sc = {
- helper: {
- log: function (message) {
- //return
- console.log(`[scdl] ${message}`)
- },
- prettyError: function (string) {
- const MAX_LENGTH = 200
- const type = typeof (string)
- if (type !== "string") return `(gak bisa nampilin teks karena type yg di kasih adalah ${type})`
- if (!string) return '(empty message)'
- let message = string
- try {
- message = JSON.stringify(JSON.parse(string), null, 2)
- } catch (_) { }
- if (message.length > MAX_LENGTH) {
- message = message.substring(0, MAX_LENGTH) + `... (trimmed ${string.length - MAX_LENGTH} characters)`
- }
- return message
- }
- },
- static: {
- baseHeaders: {
- 'accept-encoding': 'gzip, deflate, br, zstd',
- 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1'
- }
- },
- getTrackMetadata: async function (mobileUrl) {
- this.helper.log('get track metadata, client id, etc...')
- const r = await fetch(mobileUrl, { headers: this.static.baseHeaders })
- if (!r.ok) throw Error(`getTrackMetadata function. ${r.status} ${r.statusText}\n${this.helper.prettyError(await r.text())}`)
- const html = await r.text()
- const match = html.match(/__NEXT_DATA__" type="application\/json">(.+?)<\/script\>\</)?.[1]
- if (!match) throw Error('gagal mendapatkan track metadata')
- const json = JSON.parse(match)
- return json
- },
- toMobileUrl: function (trackUrl) {
- const url = new URL(trackUrl)
- if (!url.host.startsWith('m.')) url.host = 'm.' + url.host
- return url
- },
- getProgressiveUrl: async function (tmObj) {
- this.helper.log('get progressive url')
- const ctm = Object.entries(tmObj.props.pageProps.initialStoreState.entities.tracks)[0][1].data
- const purl = ctm.media.transcodings.find(a => a.format.protocol === 'progressive')?.url
- if (!purl) throw Error(`tidak menemukan progressive url`)
- const track_authorization = ctm.track_authorization
- const client_id = tmObj.runtimeConfig.clientId
- const url = new URL(purl)
- url.search = new URLSearchParams({
- client_id, track_authorization, 'stage': ''
- })
- const headers = this.static.baseHeaders
- const title = ctm.title
- const user = tmObj.head.find(p => p[1].name == 'twitter:audio:artist_name')?.[1]?.content
- const like = ctm.likes_count
- const comment = ctm.comment_count
- const imageUrl = ctm.artwork_url.replace('large', 't1080x1080') // gw makek fixed size 1080 ya haha
- const r = await fetch(url, {
- headers,
- });
- if (!r.ok) throw Error(`getProgressiveUrl function. ${r.status} ${r.statusText}\n${this.helper.prettyError(await r.text())}`)
- const json = await r.json()
- const audioUrl = json.url
- return {title, user, like, comment, imageUrl, audioUrl}
- },
- downloadTrack: async function (trackUrl) {
- const murl = this.toMobileUrl(trackUrl)
- const tmObj = await this.getTrackMetadata(murl)
- const result = await this.getProgressiveUrl(tmObj)
- this.helper.log('success')
- return result
- }
- }
- // cara pakai
- sc.downloadTrack('https://soundcloud.com/nocopyrightsounds/sub-urban-cradles-ncs-release')
- .then(console.log)
- .catch(console.log)
- /* output
- {
- title: 'Sub Urban - Cradles [NCS Release]',
- user: 'NCS',
- like: 680710,
- comment: 30040,
- imageUrl: 'https://i1.......sid-t1080x1080.jpg',
- audioUrl: 'https://cf-media.sndcdn.com/P.....&Key-Pair-Id=APKAI6TU7MMXM5DG6EPQ'
- }
- */
- // export default sc
Advertisement
Comments
-
- for me, one of the best downloader of SoundCloud Music is ViWizard SoundCloud Music Downloader: https://www.viwizard.com/soundcloud-music-tips/best-soundcloud-downloaders.html. if you use this platform, just try.
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=qtfpnxpecd
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment