wolfyflutter

71. soundcloud track downloader [downloader] [audio] [official api]

Nov 29th, 2025 (edited)
194
0
Never
9
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   nama   : soundcloud track downloader
  3.   base   : https://soundcloud.com
  4.   by     : wolep
  5.   update : 30 november 2025 1 PM
  6.   node   : v24.11.1
  7.   note   : idk, enjoy
  8.   module : esm (tested) / cjs (gak tau coba test yah :v)
  9. */
  10.  
  11. const sc = {
  12.     helper: {
  13.         log: function (message) {
  14.             //return
  15.             console.log(`[scdl] ${message}`)
  16.         },
  17.  
  18.         prettyError: function (string) {
  19.             const MAX_LENGTH = 200
  20.             const type = typeof (string)
  21.             if (type !== "string") return `(gak bisa nampilin teks karena type yg di kasih adalah ${type})`
  22.             if (!string) return '(empty message)'
  23.             let message = string
  24.             try {
  25.                 message = JSON.stringify(JSON.parse(string), null, 2)
  26.             } catch (_) { }
  27.             if (message.length > MAX_LENGTH) {
  28.                 message = message.substring(0, MAX_LENGTH) + `... (trimmed ${string.length - MAX_LENGTH} characters)`
  29.             }
  30.             return message
  31.         }
  32.     },
  33.  
  34.     static: {
  35.         baseHeaders: {
  36.             'accept-encoding': 'gzip, deflate, br, zstd',
  37.             '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'
  38.         }
  39.     },
  40.  
  41.     getTrackMetadata: async function (mobileUrl) {
  42.         this.helper.log('get track metadata, client id, etc...')
  43.         const r = await fetch(mobileUrl, { headers: this.static.baseHeaders })
  44.         if (!r.ok) throw Error(`getTrackMetadata function. ${r.status} ${r.statusText}\n${this.helper.prettyError(await r.text())}`)
  45.         const html = await r.text()
  46.         const match = html.match(/__NEXT_DATA__" type="application\/json">(.+?)<\/script\>\</)?.[1]
  47.         if (!match) throw Error('gagal mendapatkan track metadata')
  48.         const json = JSON.parse(match)
  49.         return json
  50.     },
  51.  
  52.     toMobileUrl: function (trackUrl) {
  53.         const url = new URL(trackUrl)
  54.         if (!url.host.startsWith('m.')) url.host = 'm.' + url.host
  55.         return url
  56.     },
  57.  
  58.     getProgressiveUrl: async function (tmObj) {
  59.         this.helper.log('get progressive url')
  60.  
  61.         const ctm = Object.entries(tmObj.props.pageProps.initialStoreState.entities.tracks)[0][1].data
  62.  
  63.         const purl = ctm.media.transcodings.find(a => a.format.protocol === 'progressive')?.url
  64.         if (!purl) throw Error(`tidak menemukan progressive url`)
  65.  
  66.         const track_authorization = ctm.track_authorization
  67.  
  68.         const client_id = tmObj.runtimeConfig.clientId
  69.  
  70.         const url = new URL(purl)
  71.         url.search = new URLSearchParams({
  72.             client_id, track_authorization, 'stage': ''
  73.         })
  74.         const headers = this.static.baseHeaders
  75.  
  76.         const title = ctm.title
  77.         const user = tmObj.head.find(p => p[1].name == 'twitter:audio:artist_name')?.[1]?.content
  78.         const like = ctm.likes_count
  79.         const comment = ctm.comment_count
  80.         const imageUrl = ctm.artwork_url.replace('large', 't1080x1080') // gw makek fixed size 1080 ya haha
  81.        
  82.         const r = await fetch(url, {
  83.             headers,
  84.         });
  85.  
  86.         if (!r.ok) throw Error(`getProgressiveUrl function. ${r.status} ${r.statusText}\n${this.helper.prettyError(await r.text())}`)
  87.  
  88.         const json = await r.json()
  89.         const audioUrl = json.url
  90.         return {title, user, like, comment, imageUrl, audioUrl}
  91.     },
  92.  
  93.     downloadTrack: async function (trackUrl) {
  94.         const murl = this.toMobileUrl(trackUrl)
  95.         const tmObj = await this.getTrackMetadata(murl)
  96.         const result = await this.getProgressiveUrl(tmObj)
  97.         this.helper.log('success')
  98.         return result
  99.     }
  100. }
  101.  
  102. // cara pakai
  103. sc.downloadTrack('https://soundcloud.com/nocopyrightsounds/sub-urban-cradles-ncs-release')
  104.     .then(console.log)
  105.     .catch(console.log)
  106.  
  107. /* output
  108. {
  109.   title: 'Sub Urban - Cradles [NCS Release]',
  110.   user: 'NCS',
  111.   like: 680710,
  112.   comment: 30040,
  113.   imageUrl: 'https://i1.......sid-t1080x1080.jpg',
  114.   audioUrl: 'https://cf-media.sndcdn.com/P.....&Key-Pair-Id=APKAI6TU7MMXM5DG6EPQ'  
  115. }
  116. */
  117.  
  118. // export default sc
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • # text 0.21 KB | 0 0
    1. 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.
  • User was banned
  • Dumorep
    26 min
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=qtfpnxpecd
    4.  
    5. 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.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment