Hello! I’d like to write a script to download videos from streamingcommunity.estate from a given video URL, and to do this I need the m3u8 file url. Currently I manually go to the network tab to search for it, but I’d like the script to do this automatically. Do you know of a way to achieve this? Bash or Python if possible, otherwise any other method will do fine. Thanks in advance!

@free@lemmy.world
link
fedilink
English
29M

How did u go op? I tried to get stream video and failed in my methods. 😥

tubbadu
creator
link
fedilink
English
19M

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

const puppeteer = require('puppeteer');

// This is where we'll put the code to get around the tests.



function findPlaylistUrl(networkUrls) {
  for (const url of networkUrls) {
    if (url.startsWith('https://vixcloud.co/playlist')) {
      return url;
    }
  }
  return ''; // Return an empty string if no matching URL is found
}

(async () => {
  // Check if URL argument is provided
  if (process.argv.length <= 2) {
    console.error('Usage: node get_network_urls.js <URL>');
    process.exit(1);
  }

  const url = process.argv[2];

  // Launch a headless browser
  const browser = await puppeteer.launch({ headless: 'true' });
  const page = await browser.newPage();

  // Enable request interception
  await page.setRequestInterception(true);

  // Capture network requests
  const networkUrls = [];
  page.on('request', (request) => {
    networkUrls.push(request.url());
    request.continue();
  });

  // Navigate to the URL
  await page.goto(url);

  // Wait for a while to capture network requests (adjust as needed)
  await page.waitForTimeout(5000);

  // Print the captured network URLs
  console.log(findPlaylistUrl(networkUrls));
    
  // Close the browser
  await browser.close();
})();

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

@free@lemmy.world
link
fedilink
English
19M

Thanks heaps for reply. Legend. After using chatgpt and bingchat I got the script cleaned up and working but unfortunately no output. 😥 I dont need the content, I just like to defeat these websites. Oh well. Dont want to bother you. My command was “node your-script.js https://streamingcommunity.express/watch/3330

tubbadu
creator
link
fedilink
English
19M

uhm that’s strange, I just tried executing it on your link and it worked. have you waited at least 5 seconds after running the script?

@free@lemmy.world
link
fedilink
English
19M

Thanks for reply, appreciate it. The thing is when i try your code it errors out. So I had to use bingchat or chatgpt to clean it up. Any chance you could upload your file somewhere please?

@ISOmorph@feddit.de
link
fedilink
English
7
edit-2
10M

youtube-dl does something similar (it works on a lot more than just youtube). AFAIK each site needs a slightly altered code. You could have a look at the source on their github.

It might be as easy as forking the project and creating your own extractor.py.

tubbadu
creator
link
fedilink
English
110M

I actually use yd-dlp to download m3u8 playlists, but what I’m looking for is a way to extract the m3u8 file URL, so that I can give it to ytdlp to download the actual video

I’ll look into the extractor docs, seems interesting! Thanks!

I sure hope they commit the work back into the main repo…

@ISOmorph@feddit.de
link
fedilink
English
710M

I doubt they would be able to. I was interested and looked around a bit. There’s even a whole chapter in their documentation dedicated to adding extractors. First paragraph of that chapter is basically ‘‘do not add piracy websites’’

slugger
link
fedilink
English
410M

There is firefox addon that i just found which does this. It’s called: Extract video link. Maybe look at source code.

tubbadu
creator
link
fedilink
English
110M

I’ll look into it, thanks!

jDownloader might do this automatically if given the video url.

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ
!piracy@lemmy.dbzer0.com
Create a post
⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don’t request invites, trade, sell, or self-promote

3. Don’t request or link to specific pirated titles, including DMs

4. Don’t submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

  • 1 user online
  • 146 users / day
  • 291 users / week
  • 1K users / month
  • 3.48K users / 6 months
  • 1 subscriber
  • 3.4K Posts
  • 82.3K Comments
  • Modlog