wolfyflutter

38. ytmp3.as [youtube] [downloader] [audio] [video]

Jul 26th, 2025 (edited)
489
0
Never
9
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 5.72 KB | Source Code | 0 0
  1. /*
  2.   base    : https://ytmp3.as
  3.   update  : 27 agustus 2025
  4.   by      : wolep
  5.   node    : v24.5.0
  6.   note    : buat download mp3, mp4 dari
  7.             youtube biasa, youtube short
  8.             dan youtube music
  9.             support esm dan cjs
  10.             skrep nya kadang ku cek ya
  11. */
  12.  
  13. const yt = {
  14.     get baseHeaders() {
  15.         return {
  16.             'accept-encoding': 'gzip, deflate, br, zstd'
  17.         }
  18.     },
  19.  
  20.     get url() {
  21.         return {
  22.             origin: 'https://ytmp3.as'
  23.         }
  24.     },
  25.  
  26.     extractVideoId: function (fV) {
  27.         let v
  28.         if (fV.indexOf('youtu.be') > -1) {
  29.             v = /\/([a-zA-Z0-9\-\_]{11})/.exec(fV);
  30.         } else if (fV.indexOf('youtube.com') > -1) {
  31.             if (fV.indexOf('/shorts/') > -1) {
  32.                 v = /\/([a-zA-Z0-9\-\_]{11})/.exec(fV);
  33.             } else {
  34.                 v = /v\=([a-zA-Z0-9\-\_]{11})/.exec(fV);
  35.             }
  36.         }
  37.         const result = v?.[1]
  38.         if (!result) throw Error(`gagal extract video id`)
  39.         return result
  40.     },
  41.  
  42.     getInitUrl: async function () {
  43.             "use strict"
  44.         try {
  45.             const r1 = await fetch(this.url.origin, { headers: this.baseHeaders })
  46.             console.log('hit homepage')
  47.  
  48.             const html = await r1.text()
  49.             const jsPath = html.match(/<script src="(.+?)"/)?.[1]
  50.             const jsUrl = this.url.origin + jsPath
  51.  
  52.             const r2 = await fetch(jsUrl, { headers: this.baseHeaders })
  53.             console.log('hit js')
  54.             const js = await r2.text()
  55.  
  56.             // ayo main eval evalan
  57.  
  58.             // cari gB
  59.             const gB_m = js.match(/gB=(.+?),gD/)?.[1]
  60.             const gB = eval(gB_m)
  61.  
  62.             // cari gC
  63.             const html_m = html.match(/<script>(.+?)<\/script>/)?.[1]
  64.             const hiddenGc = eval(html_m + "gC")
  65.             const gC = Object.fromEntries(Object.getOwnPropertyNames(hiddenGc).map(key => [key, hiddenGc[key]]))
  66.  
  67.             // fungsi
  68.             const decodeBin = (d) => d.split(' ').map(v => parseInt(v, 2))
  69.             const decodeHex = (d) => d.match(/0x[a-fA-F0-9]{2}/g).map(v => String.fromCharCode(v)).join("")
  70.             function authorization() {
  71.                 var dec = decodeBin(gC.d(1)[0]);
  72.                 var k = '';
  73.                 for (var i = 0; i < dec.length; i++) k += (gC.d(2)[0] > 0) ? atob(gC.d(1)[1]).split('').reverse().join('')[(dec[i] - gC.d(2)[1])] : atob(gC.d(1)[1])[(dec[i] - gC.d(2)[1])];
  74.                 if (gC.d(2)[2] > 0) k = k.substring(0, gC.d(2)[2]);
  75.                 switch (gC.d(2)[3]) {
  76.                     case 0:
  77.                         return btoa(k + '_' + decodeHex(gC.d(3)[0]));
  78.                     case 1:
  79.                         return btoa(k.toLowerCase() + '_' + decodeHex(gC.d(3)[0]));
  80.                     case 2:
  81.                         return btoa(k.toUpperCase() + '_' + decodeHex(gC.d(3)[0]));
  82.                 }
  83.             }
  84.  
  85.             const api_m = js.match(/t.open\("GET",(.+?),!/)?.[1]
  86.             const apiUrl = eval(api_m)
  87.             return apiUrl
  88.         } catch (e) {
  89.             throw new Error('fungsi getApiUrl gagal')
  90.         }
  91.     },
  92.  
  93.     download: async function (url, f = 'mp3') {
  94.         // validation format
  95.         if (!/^mp3|mp4$/.test(f)) throw Error(`format valid mp3 or mp4`)
  96.  
  97.         // extract video id
  98.         const v = this.extractVideoId(url)
  99.  
  100.         const headers = {
  101.             'referer': this.url.origin,
  102.             ...this.baseHeaders
  103.         }
  104.  
  105.         // get init url
  106.         const initApi = await this.getInitUrl()
  107.  
  108.         // hit init
  109.         const r1 = await fetch(initApi, { headers })
  110.         console.log('hit init')
  111.  
  112.         const j1 = await r1.json()
  113.         const { convertURL } = j1
  114.  
  115.         // hit convertURL
  116.         const convertApi = convertURL + '&v=' + v + '&f=' + f + '&_=' + Math.random()
  117.         const r2 = await fetch(convertApi, { headers })
  118.         console.log('hit convert url')
  119.  
  120.         const j2 = await r2.json()
  121.         if (j2.error) {
  122.             throw Error(`ada error di value convert. nih\n${JSON.stringify(j2, null, 2)}`)
  123.         }
  124.  
  125.         if (j2.redirectURL) {
  126.             const r3 = await fetch(j2.redirectURL, { headers })
  127.             console.log('hit redirect')
  128.             const j3 = await r3.json()
  129.             const result = {
  130.                 title: j3.title,
  131.                 downloadURL: j3.downloadURL,
  132.                 format: f
  133.             }
  134.             return result
  135.         } else {
  136.             // luping
  137.             let j3b
  138.             do {
  139.                 const r3b = await fetch(j2.progressURL, { headers })
  140.                 console.log('hit progress')
  141.                 j3b = await r3b.json()
  142.                 if (j3b.error) throw Error(`ada error pas cek progress. nih\n${JSON.stringify(j3b, null, 2)}`)
  143.                 if (j3b.progress == 3) {
  144.                     const result = {
  145.                         title: j3b.title,
  146.                         downloadURL: j2.downloadURL,
  147.                         format: f
  148.                     }
  149.                     return result
  150.                 }
  151.                 await new Promise(resolve => setTimeout(resolve, 3000))
  152.             } while (j3b.error != 3)
  153.         }
  154.     }
  155. }
  156.  
  157. // cara pakai
  158. yt.download('https://www.youtube.com/watch?v=Fmf-G9fpwto', 'mp3')
  159.     .then(console.log)
  160.     .catch(console.log)
  161.  
  162.  
  163. /* output
  164. {
  165.   title: 'Diamond Eyes - Stars | Dubstep | NCS - Copyright Free Music',
  166.   downloadURL: 'https://ummn.ummn.nu/api/v1/download?sig=W%2B%2...........fVJHdP%2F%2BxcO%2FfA%3D%3D',
  167.   format: 'mp3'
  168. }
  169.  
  170.  
  171. atauuuuu.....
  172. yt.download('yt_url', 'mp4') -> untuk download mp4
  173. yt.download('yt_url', 'mp3') -> untuk download mp3
  174. yt.download('yt_url') -> empty param download mp3 juga
  175. */
  176.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Xarvekig
    15 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    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
  • Rekegbi
    5 hours
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=mfbllumjrt
    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