Ajuda com fastream

  • Autor Autor Armandolqr
  • Data de início Data de início
Tradução em andamento: em alguns minutos este tópico estará em português. Por enquanto, o conteúdo está no original em espanhol. Ver original
Armandolqr

Armandolqr

Gamma
Usuário com poucas negociações! Use sempre o saldo do ForoBeta!
como puedo hacer el get con la ip del usuario o algo que evite el bloqueo del m3u8 https://fas.freeserver1.workers.dev/?v=https://fastream.to/embed-3aoxast68rvp.html {
"sources": [
{
"file": "https://s39.fastream.to/hls2/03/000...2g&s=1744648576&e=43200&v=39184542&i=0.3&sp=0"
}
]
}







addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
})
async function handleRequest(request) {
const url = new URL(request.url);
const filelink = url.searchParams.get('v');
if (!filelink || !filelink.includes('fastream.')) {
return new Response(JSON.stringify({ error: 'Invalid video link' }), {
status: 400,
headers: { 'Content-Type': 'application/json' },
});
}
// Realizar la solicitud HTTP a Fastream
const fastreamResponse = await fetch(filelink, {
method: 'GET',
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; rv:81.0) Gecko/20100101 Firefox/81.0',
'Referer': 'https://fastream.to/',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
},
});
if (!fastreamResponse.ok) {
return new Response(JSON.stringify({ error: 'Failed to fetch video data' }), {
status: 500,
headers: { 'Content-Type': 'application/json' },
});
}
const html = await fastreamResponse.text();
// Si el código está empaquetado, intentamos desempaquetarlo
let unpackedHtml = html;
if (/eval\(function\(p,a,c,k,e,[rd]/.test(html)) {
unpackedHtml = jsUnpack(html);
}
// Extraer el enlace del archivo .m3u8
const match = unpackedHtml.match(/file\s*:\s*"([^"]+)"/);
if (match && match[1]) {
const videoUrl = match[1];
return new Response(
JSON.stringify({ sources: [{ file: videoUrl }] }, null, 2),
{
headers: { 'Content-Type': 'application/json' },
}
);
} else {
return new Response(JSON.stringify({ error: 'Video URL not found' }), {
status: 404,
headers: { 'Content-Type': 'application/json' },
});
}
}
// Función para desempaquetar JavaScript (similitud con JavaScriptUnpacker.php)
function jsUnpack(content) {
const regex = /}\('(.)', *(\d+), *(\d+), *'(.?)'\.split\('\|'\)/;
const match = regex.exec(content);
if (!match) return content;
const payload = match[1];
const radix = parseInt(match[2], 10);
const count = parseInt(match[3], 10);
const symtab = match[4].split('|');
if (count !== symtab.length) return content; // Error de formato
const unbaser = new Unbaser(radix);
let result = payload.replace(/\b\w+\b/g, (word) => {
return symtab[unbaser.unbase(word)] || word;
});
result = result.replace(/\\/g, ''); // Limpiar las barras invertidas
return result;
}
class Unbaser {
constructor(base) {
this.base = base;
this.selector = 52;
this.ALPHABET = {
52: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP',
54: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR',
62: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
95: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
};
if (this.base > 62) this.selector = 95;
else if (this.base > 54) this.selector = 62;
else if (this.base > 52) this.selector = 54;
}
unbase(val) {
if (2 <= this.base && this.base <= 36) {
return parseInt(val, this.base);
} else {
if (!this.dict) {
this.dict = Object.fromEntries(
Array.from(this.ALPHABET[this.selector]).map((char, index) => [char, index])
);
}
let ret = 0;
const valArray = Array.from(val).reverse();
for (let i = 0; i < valArray.length; i++) {
const cipher = valArray;
ret += Math.pow(this.base, i) * this.dict[cipher];
}
return ret;
}
}
}
 
Foi útil? Participe da conversa

Com sua conta grátis você pode responder, mandar mensagem privada ao autor e comprar com Saldo retido: o pagamento é liberado quando você recebe o combinado.

Leva 30 segundos · você volta a este tópico ao terminar
tienes 2 opciones, crear un PLUGIN, que el usuario instale en su navegador y asi usar su IP, para solicitar el trafico y Saltarte el CORS de la web destino. o hacer un WEBAPP (ejecutable) que sea un navegador embebido como con ELECTRON o algun similar y tener control de ello.
 
Hola, mira esas webs generalmente no usan la ip ni nada, se que tienes un proyecto si quieres podemos colaborar, volviendo con el problema es las cookies usan csrftoken y otros sistemas con las cookies.
 
Hola, mira esas webs generalmente no usan la ip ni nada, se que tienes un proyecto si quieres podemos colaborar, volviendo con el problema es las cookies usan csrftoken y otros sistemas con las cookies.
Te di el problema no la solución jajaj
 
Voltar
Topo