Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
How to scrape actual media url instead of blob in Javascript?

I'm trying to scrape some websites for practise, these websites are javascript rendered sites so I'm using nightmarejs to scrape them, It was working flawless until one time it started to give me blob URL instead of actual .mp4 URL, I looked into chrome dev tools network activity, I see that .m3u8 file is being loaded but in src it shows blob url instead of .m3u8.

Please suggest me what changes shall i make?

Here's my code sample,

app.get("/video/:VideoName", function(req,res){
  var VideoName = req.params.VideoName;
  request("https://sample.com/videos/"+VideoName, function(err, response, html){
    if(!err && response.statusCode == 200){
      const $ = cheerio.load(html);
      const videoInfo = $(".video-info");
//fetch video link if not already avilable
const includesVideo = VidLinks.find(e => e.name == VideoName)
if (includesVideo) {
  res.render("videoPlayer",{episode: includesVideo});
} else {
  const Nightmare = require('nightmare')
  const nightmare = Nightmare({ show: true })
  var iframeLink = videoInfo.find("iframe").attr("src");
  iframeLink = iframeLink.replace(/\/\//g, "https://");
  const videoLink =  nightmare
      .goto(iframeLink)
      .click("#myVideo")
      .evaluate(function(){

        //return html
        return document.body.innerHTML;


    }).end().then(function(body){
    //loading html body to cheerio
        var $ = cheerio.load(body);
        const videoLink = $("#myVideo").find("video").attr("src");
        console.log("is this video link? " + videoLink);
        return videoLink;
    }).then(function(videoLink){
        VidLinks.push(videoLink);
        res.render("videoPlayer",{video: videoLink});
    });
};
    } else {
      res.send("500 Error, Try Again.");
      console.log("ERROR IS HERE! - "+err);
    }
  });
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda