mirror of
https://github.com/snobu/destreamer.git
synced 2026-01-23 16:32:16 +00:00
Fix login for private tenants, improved refresh reliability (#181)
This commit is contained in:
@@ -53,8 +53,8 @@ export class TokenCache {
|
||||
}
|
||||
|
||||
|
||||
export async function refreshSession(): Promise<Session> {
|
||||
const url = 'https://web.microsoftstream.com';
|
||||
export async function refreshSession(url: string): Promise<Session> {
|
||||
const videoId: string = url.split('/').pop() ?? process.exit(ERROR_CODE.INVALID_VIDEO_GUID);
|
||||
|
||||
const browser: puppeteer.Browser = await puppeteer.launch({
|
||||
executablePath: getPuppeteerChromiumPath(),
|
||||
@@ -70,7 +70,7 @@ export async function refreshSession(): Promise<Session> {
|
||||
const page: puppeteer.Page = (await browser.pages())[0];
|
||||
await page.goto(url, { waitUntil: 'load' });
|
||||
|
||||
await browser.waitForTarget((target: puppeteer.Target) => target.url().includes(url), { timeout: 30000 });
|
||||
await browser.waitForTarget((target: puppeteer.Target) => target.url().includes(videoId), { timeout: 30000 });
|
||||
|
||||
let session: Session | null = null;
|
||||
let tries = 1;
|
||||
|
||||
Reference in New Issue
Block a user