There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

tubbadu OP ,

hi, sorry for the late reply! I finally wrote this nodejs script:


<span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">puppeteer </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">require(</span><span style="color:#183691;">'puppeteer'</span><span style="color:#323232;">);
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">// This is where we'll put the code to get around the tests.
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">findPlaylistUrl</span><span style="color:#323232;">(networkUrls) {
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">(</span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">url </span><span style="font-weight:bold;color:#a71d5d;">of </span><span style="color:#323232;">networkUrls) {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(url.startsWith(</span><span style="color:#183691;">'https://vixcloud.co/playlist'</span><span style="color:#323232;">)) {
</span><span style="color:#323232;">      </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#323232;">url;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#183691;">''</span><span style="color:#323232;">; </span><span style="font-style:italic;color:#969896;">// Return an empty string if no matching URL is found
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">(</span><span style="font-weight:bold;color:#a71d5d;">async </span><span style="color:#323232;">() </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Check if URL argument is provided
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(</span><span style="color:#0086b3;">process</span><span style="color:#323232;">.</span><span style="color:#0086b3;">argv</span><span style="color:#323232;">.length </span><span style="font-weight:bold;color:#a71d5d;"><= </span><span style="color:#0086b3;">2</span><span style="color:#323232;">) {
</span><span style="color:#323232;">    </span><span style="color:#795da3;">console</span><span style="color:#323232;">.</span><span style="color:#0086b3;">error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Usage: node get_network_urls.js <URL>'</span><span style="color:#323232;">);
</span><span style="color:#323232;">    </span><span style="color:#0086b3;">process</span><span style="color:#323232;">.</span><span style="color:#0086b3;">exit</span><span style="color:#323232;">(</span><span style="color:#0086b3;">1</span><span style="color:#323232;">);
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">url </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">process</span><span style="color:#323232;">.</span><span style="color:#0086b3;">argv</span><span style="color:#323232;">[</span><span style="color:#0086b3;">2</span><span style="color:#323232;">];
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Launch a headless browser
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">browser </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">await puppeteer.launch({ headless: </span><span style="color:#183691;">'true' </span><span style="color:#323232;">});
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">page </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">await browser.newPage();
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Enable request interception
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">await </span><span style="color:#323232;">page.setRequestInterception(</span><span style="color:#0086b3;">true</span><span style="color:#323232;">);
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Capture network requests
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">networkUrls </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">[];
</span><span style="color:#323232;">  page.on(</span><span style="color:#183691;">'request'</span><span style="color:#323232;">, (request) </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{
</span><span style="color:#323232;">    networkUrls.</span><span style="color:#0086b3;">push</span><span style="color:#323232;">(request.url());
</span><span style="color:#323232;">    request.continue();
</span><span style="color:#323232;">  });
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Navigate to the URL
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">await </span><span style="color:#323232;">page.goto(url);
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Wait for a while to capture network requests (adjust as needed)
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">await </span><span style="color:#323232;">page.waitForTimeout(</span><span style="color:#0086b3;">5000</span><span style="color:#323232;">);
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Print the captured network URLs
</span><span style="color:#323232;">  </span><span style="color:#795da3;">console</span><span style="color:#323232;">.</span><span style="color:#0086b3;">log</span><span style="color:#323232;">(findPlaylistUrl(networkUrls));
</span><span style="color:#323232;">    
</span><span style="color:#323232;">  </span><span style="font-style:italic;color:#969896;">// Close the browser
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">await </span><span style="color:#323232;">browser.</span><span style="color:#0086b3;">close</span><span style="color:#323232;">();
</span><span style="color:#323232;">})();
</span>

the first argument passed to the script is the url of the webpage. The script uses the puppeteer module to “fake” a browser, in order to receive all the network calls and so on, and then will search through them for the m3u8 playlist. It is very specific and only works on this website, but it can be easily adapted for other websites as well

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines