Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support media stream #337

Closed
merloisac opened this issue Aug 31, 2021 · 6 comments · Fixed by #339
Closed

Support media stream #337

merloisac opened this issue Aug 31, 2021 · 6 comments · Fixed by #339

Comments

@merloisac
Copy link

I am trying to scrape some HTTP Live Streaming (HLS) Transmissions, but I couldn't find a way to do, is it supported by SA?

import {Agent} from 'secret-agent';

(async () => {
    process.env.SA_SHOW_BROWSER = 'true';
    process.env.SA_SHOW_REPLAY = "true";
    const agent = new Agent({
        userAgent: 'chrome-latest',
    });

    await agent.goto(`https://hls-js.netlify.app/demo/`);
    await agent.waitForMillis(100000);

})();

Status: Your Browser does not support MediaSourceExtension / MP4 mediasource

@ctaity
Copy link

ctaity commented Aug 31, 2021

cannot get de m3u8 file? what protection have that server?

@merloisac
Copy link
Author

I'm not sure what kind on protection it does have, but the m3u8 file keep loading forever when the request is made outside the initial browser

@ctaity
Copy link

ctaity commented Sep 1, 2021

can you share the m3u8 url?

@merloisac
Copy link
Author

I can't send here cause there are some personal data on the URL I wouldn't mind to share on private

@blakebyrnes
Copy link
Contributor

It looks like there's a bug in the "codecs" overrides. Will fix shortly - I need to figure out if we still even need these overrides now that we're running on full-chrome

@merloisac
Copy link
Author

merloisac commented Sep 27, 2021

Re-opening it cause the same problem started to happen, the website I'm trying to scrape now is twitch.tv, the m3u8 is loading forever until it reaches timeout

import {Agent} from 'secret-agent';

(async () => {
    process.env.SA_SHOW_BROWSER = "true";
    const agent = new Agent();
    await agent.goto(`https://player.twitch.tv/?channel=gaules&enableExtensions=true&muted=false&parent=twitch.tv&player=popout&volume=0.5&mature=true&quality=160p30`);
    const m3u8 = await agent.waitForResource({url:/m3u8/}, {timeoutMs: 120000});
    console.log(m3u8[0].url);
    await agent.waitForMillis(100000);

})();

;Edit
The same doesn't happen on normal chrome browser, it loads "instantly"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants