Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda