From caf9803e2268abb9ec1c8aefc0bebba86775d94b Mon Sep 17 00:00:00 2001 From: Adrian Calinescu Date: Sat, 21 Mar 2020 21:25:30 +0200 Subject: [PATCH 1/2] Fix minor formatting in README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7af3929..c2a2c94 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ Destreamer takes a [honeybadger](https://www.youtube.com/watch?v=4r7wHMg5Yjg) ap ## USAGE * Edit `destreamer.ts` and replace the username const with your own, you may still need to enter your password or go through 2FA if you don't have the STS cookie saved in Chrome. If you do (i.e. you usually log in to Microsoft Stream with Chrome), then you may try turning `headless: false` to `true` for a truly headless experience) -======= * Edit `destreamer.ts` (`.js` if using the vanilla JS master branch) and replace the username const with your own, you may still need to enter your password or go through 2FA if you don't have the STS cookie saved in Chrome. If you do (i.e. you usually log in to Microsoft Stream with Chrome), then you may try turning `headless: false` to `true` for a truly headless experience) * `npm install` to restore packages* `npm install` to restore packages * `npm run -s build` to transpile TypeScript to JavaScript @@ -56,7 +55,7 @@ You can use an absolute path for `--outputDirectory`, for example `/mnt/videos`. ### To download a list of videos -~~There's no implementation that does that (yet). There's some work happening to support this, give it some time.~~ +~~There's no implementation that does that (yet). There's some work happening to support this, give it some time.~~
See usage above. ## EXPECTED OUTPUT From bf3850753512e0ed14e2ce935f7a04aa8e924ec6 Mon Sep 17 00:00:00 2001 From: snobu Date: Sat, 21 Mar 2020 21:36:33 +0200 Subject: [PATCH 2/2] Fix for double quotes in video title https://github.com/snobu/destreamer/issues/11 --- destreamer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/destreamer.ts b/destreamer.ts index 753fd05..6c306ed 100644 --- a/destreamer.ts +++ b/destreamer.ts @@ -90,12 +90,15 @@ async function rentVideoForLater(videoUrls: string[], username: string, outputDi () => { return amp.Player.players["vjs_video_3"].cache_.src } ); - const title = await page.evaluate( + let title = await page.evaluate( // Clear abuse of null assertion operator, // someone fix this please () => { return document!.querySelector(".title")!.textContent!.trim() } ); + // Sanitize title + title = title.replace(/"/g, ''); + console.log(`Video title is: ${title}`); console.log('Constructing HLS URL...');