Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!