const axios = require('axios'); const client = axios.create({ baseURL: 'https://scriptpastebins.com', headers: { 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36' } }); client.interceptors.response.use(res => { const cookies = res.headers['set-cookie']; if (cookies && cookies.length) { client.defaults.headers.common['Cookie'] = cookies.map(c => c.split(';')[0]).join('; '); } return res; }); function getScript(url) { client.get(url, { headers: { 'Referer': url } }) .then(() => { const withParam = url.includes('?') ? url + '&r=1' : url + '?r=1'; return client.get(withParam, { headers: { 'Referer': url } }); }) .then(res => { let html = res.data; html = html.replace(/"/g, '"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/'/g, "'"); const containers = [ { open: '' }, { open: '' }, { open: '' } ]; for (const c of containers) { const start = html.indexOf(c.open); if (start !== -1) { const end = html.indexOf(c.close, start); if (end !== -1) { const result = html.substring(html.indexOf('>', start) + 1, end).trim(); if (result && result.length > 10) { console.log(result); return; } } } } console.log('No script found'); }) .catch(err => console.error('Error:', err.message)); } getScript('https://scriptpastebins.com/black-v-kaitun-hub-blox-fruits-script/');