snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.37k stars 439 forks source link

Getting destreamer working on M1/M2 macs + using all latest packages + sharepoint videos. Tested + working. #489

Open hakt0-r opened 1 year ago

hakt0-r commented 1 year ago

I've just managed to get this working, and that too on my M1 mac running macOS Ventura 13.4.1.

I'll try to lay out what I've done to fix and hopefully can create a pull request and fix this too for all.

These are macOS specific instructions, though you can ignore macOS bits and make it work for other OS's.

  1. brew install chromium

  2. To avoid running into "chromium.app is damaged error" (see https://github.com/Homebrew/homebrew-cask/issues/112986#issue-1031594353) Run these two commands. (it'll set the right flags for macOS SIP/watchdog/whatever)

    xattr -cr /opt/homebrew/bin/chromium xattr -cr /Applications/Chromium.app

  3. git clone --branch sharepoint https://github.com/snobu/destreamer.git

  4. cd into that directory

  5. edit the package.json file to change change "@types/puppeteer" : "5.5.0", to "puppeteer" : "^19.11.1",

change "puppeteer" : "5.5.0", to "puppeteer" : "^19.11.1",

  1. edit the tsconfig.json file to add a line after "sourceMap"... "noImplicitAny": false,

  2. now run npm install

  3. (going for gold!) We'll also update all the node packages and their versions. Run npm update --save

  4. at this stage you can now try and run npm run build You'll get a few errors! First kind... few of these... src/LoginModules.ts:14:20 - error TS2503: Cannot find namespace 'puppeteer'. and few of these... src/TokenCache.ts:60:20 - error TS2503: Cannot find namespace 'puppeteer'. to Fix this, just edit these two files and change this line => import puppeteer from 'puppeteer'; to this => import * as puppeteer from 'puppeteer';

  5. running npm run build again, gives you one more error... src/TokenCache.ts:99:24 - error TS2339: Property 'waitFor' does not exist on type 'Page'. edit src/TokenCache.ts file line 99 and change waitFor to waitForTimeout (see: https://github.com/puppeteer/puppeteer/issues/9762)

  6. Finally you are ready to build. npm run build will work.

I've successfully tested today downloading two recordings. 😄

Originally posted by @hakt0-r in https://github.com/snobu/destreamer/issues/487#issuecomment-1605586156

vmlrodrigues commented 1 year ago

I get a "No matching version found for @types/puppeteer@^19.11.1" when running npm install in step 7.

lyj0309 commented 1 year ago

what my error is

node_modules/puppeteer/lib/types.d.ts:5355:153 - error TS2304: Cannot find name 'Awaited'.

5355     evaluate<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;

then i run npm install -D typescript@latest to fix it

hakt0-r commented 1 year ago

I get a "No matching version found for @types/puppeteer@^19.11.1" when running npm install in step 7.

remove "@types/" bit leaving only "puppeteer" from the packages.json file from both the sections, devDependencies and dependencies. Please see if that works.

hakt0-r commented 1 year ago

then i run npm install -D typescript@latest to fix it

does it fix it?

If not, did you follow all the steps, exactly, like step #6 ?!?

lyj0309 commented 1 year ago

then i run npm install -D typescript@latest to fix it

does it fix it?

If not, did you follow all the steps, exactly, like step #6 ?!?

yes , i fix it

vmlrodrigues commented 1 year ago

I get a "No matching version found for @types/puppeteer@^19.11.1" when running npm install in step 7.

remove "@types/" bit leaving only "puppeteer" from the packages.json file from both the sections, devDependencies and dependencies. Please see if that works.

That worked, cheers.