Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- base : https://ytmp3.ing/
- by : wolep
- last update : 19 May 2025 - 07:00
- auditional note : sorry kalau code nya jelek :v, maklum masih belajar ehee
- */
- (async () => {
- // main function
- const ytmp3ing = async (youtubeUrl, format = "mp3") => {
- // param 1 validation
- const regYoutubeId = /https:\/\/(www.youtube.com\/watch\?v=|youtu.be\/|youtube.com\/shorts\/|youtube.com\/watch\?v=)([^&|^?]+)/
- const videoId = youtubeUrl.match(regYoutubeId)?.[2]
- if (!videoId) throw Error("invalid youtube link")
- // param 2 validation
- const availableFormat = ["mp3", "mp4"]
- const formatIndex = availableFormat.findIndex(v => v == format.toLocaleLowerCase())
- if (formatIndex == -1) throw Error(`${format} is invalid format, available format : ${availableFormat.join(", ")}. pick one!`)
- const choosenUrlPath = ["/audio", "/video"][formatIndex]
- const getCookieAndToken = async () => {
- const res = await fetch("https://ytmp3.ing/")
- if (!res.ok) throw Error(`gagal fetch ${res.url} status ${res.status} ${res.statusText}`)
- const cookie = res.headers.getSetCookie() // [1 cookie csrftoken=tog1sW4B6...]
- const html = await res.text()
- const csrfmiddlewaretoken = html.match(/value="([^"]+)"/)?.[1] //1ayShcZ1K3
- if (!csrfmiddlewaretoken) throw Error(`gagal mendapatkan csrfmiddlewaretoken`)
- console.log("got cookie and csrfmiddleware token")
- return { cookie, csrfmiddlewaretoken }
- }
- const { cookie, csrfmiddlewaretoken } = await getCookieAndToken()
- const res2 = await fetch("https://ytmp3.ing" + choosenUrlPath, {
- "headers": {
- "content-type": "multipart/form-data; boundary=----WebKitFormBoundaryeByWolep",
- "x-csrftoken": csrfmiddlewaretoken,
- "cookie": cookie,
- },
- "body": "------WebKitFormBoundaryeByWolep\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\n" + youtubeUrl + "\r\n------WebKitFormBoundaryeByWolep--\r\n",
- "method": "POST"
- })
- if (!res2.ok) throw Error(`gagal fetch ${res2.url}. kemungkinan karena video terlalu panjang / tidak di support. status ${res2.status} ${res2.statusText}`)
- let { url, filename } = await res2.json()
- url = atob(url)
- return ({ filename, url })
- }
- // how to use
- const yourLink = "https://www.youtube.com/watch?v=Hlyb9urvzck"
- ytmp3ing(yourLink, "mp3") // tambah param "mp4" jika mau download video
- .then(data => console.log(data))
- .catch(error => console.log(error.message))
- })()
- /* output
- {
- filename: 'G Sounds - point the star 2 - G Sounds.mp3',
- url: 'https://api.ytmp3.ing/tunnel?id=qXAf7z_.....c8y3GSVGhDDt1nE5g'
- }
- */
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=sjebkthgxp
- 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