Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- nama : pinterest video download
- base : https://pindown.io
- by : wolep
- update : 1 November 2025, 21:00 wita
- node : v25.0.0
- note : gak ada
- module : esm (tested) / cjs (gak tau coba test yah :v)
- */
- const pint = {
- _static: Object.freeze({
- displayLog: true, //set false untuk silent log
- taskName: '[pint skrep]',
- baseUrl: 'https://pindown.io',
- baseHeaders: {
- 'accept-encoding': 'gzip, deflate, br, zstd'
- }
- }),
- log: function (message) {
- if(!this._static.displayLog) return
- console.log(this._static.taskName + ' ' + message)
- },
- getCookieAndToken: async function () {
- this.log('mencoba ambil kuki dan hidden value')
- const r = await fetch(this._static.baseUrl, {
- headers: this._static.baseHeaders
- })
- if (!r.ok) throw Error(`${r.status} ${r.statusText || '(unknown)'} di fungsi getCookieAndToken`)
- const html = await r.text()
- const cookie = r.headers.getSetCookie().map(kuki => kuki.split(';')[0]).join('; ')
- if (!cookie) throw Error('gagal mendapatkan kuki')
- const hidden = html.match(/<input name="(?<name>.+?)" type="hidden" value="(?<value>.+?)"/)?.groups
- if (!hidden) throw Error('gagal mendapatkan hidden value')
- return { cookie, hidden }
- },
- downloadVideo: async function (pinterestUrl) {
- const { cookie, hidden } = await this.getCookieAndToken()
- this.log('mencoba mendapatkan url download')
- const body = new FormData()
- body.append('url', pinterestUrl)
- body.append(hidden.name, hidden.value)
- const headers = {
- cookie,
- ...this._static.baseHeaders
- }
- const path = '/action'
- const r = await fetch(this._static.baseUrl + path, {
- headers,
- body,
- 'method': 'post'
- })
- if (!r.ok) throw Error(`${r.status} ${r.statusText || '(unknown)'} di fungsi download`)
- const html = await r.text()
- const vidMatch = html.match(/id='vid' src='(.+?)'/)?.[1]
- const videoUrl = eval(`'${vidMatch}'`)
- if(videoUrl === 'undefined') throw Error (`gagal mendapatkan video url. pastikan url pinterest berisi video`)
- const thumbMatch = html.match(/video poster='(.+?)'/)?.[1]
- const thumbnailUrl = eval(`'${thumbMatch}'`)
- this.log('sukses')
- return ({videoUrl, thumbnailUrl })
- }
- }
- // cara pakai
- pint.downloadVideo('https://www.pinterest.com/pin/614811786672974800/')
- .then(console.log)
- .catch(err => console.log(err.message))
- /* output
- {
- thumbnailUrl: 'https://i.pinimg.com/videos/thum........0000000.jpg',
- videoUrl: 'https://v1.pinimg.com/videos......13f5a6bf77_720w.mp4'
- }
- */
- // export default pint
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=bnfzoqevat
- 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