snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.36k stars 442 forks source link

Invalid url #405

Closed DaniDiaz71 closed 2 years ago

DaniDiaz71 commented 2 years ago

Hi,

I know this is not an issue but I would like to know if you are coding a new version to download videos from corporate URLs. I'm trying to do it but URL domain is not web.microsoftstream.com, so i get Invalid URL error

Thanks!

snobu commented 2 years ago

We never use aboslute URLs in our code, expect for this line - https://github.com/snobu/destreamer/blob/1da56990bc23a743452752cd6b6fc20b458b45b5/src/destreamer.ts#L84

If you just go and change that to whatever your URL looks like after you login to your corporate MSStream tenant using your browser (company.com/ or something.company.com/), there's a good chance destreamer will work for you too.

Don't forget to npm run build after making that code change.

DaniDiaz71 commented 2 years ago

I have replaced url portion and now i'm able to log in, but session object seems to be null ¿?

Log info:

`[WARNING] Access token has expired!

Launching headless Chrome to perform the OpenID Connect dance... Navigating to login page... We are logged in.

waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code. waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code. waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code. waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code. waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code.

[FATAL ERROR] Could not evaluate sessionInfo on the page

`

lukaarma commented 2 years ago

Could you please post here your url so that I can take a look and help you?

DaniDiaz71 commented 2 years ago

Yes, It's something like this:

https://MY_CORPORATION.sharepoint.com/:v:/g/personal/USER/ETdL3jegTKRGuYLntOLM4TgBM6H9TNMr0cJJT951LUQ0Ug

I've replaced real MY_CORPORATION and USER for privacy issues.

Script stucks in this section because session object is always null, but chromium has been opened and show my corporate OneDrive. I'm using OSX enviroment.

while (!session) {
        try {
            let sessionInfo: any;
            session = await page.evaluate(
                () => {
                    return {
                        AccessToken: sessionInfo.AccessToken,
                        ApiGatewayUri: sessionInfo.ApiGatewayUri,
                        ApiGatewayVersion: sessionInfo.ApiGatewayVersion
                    };
                }
            );
        }

Thanks

lukaarma commented 2 years ago

There is a new branch for SharePoint support, please try it and give me some feedback Sharepoint support is discussed in #380, closing as duplicate