{"id":22489643,"url":"https://github.com/SamuelScheit/puppeteer-stream","last_synced_at":"2025-08-02T21:33:12.767Z","repository":{"id":37580746,"uuid":"323476566","full_name":"SamuelScheit/puppeteer-stream","owner":"SamuelScheit","description":"A Library for puppeteer to retrieve audio and video streams of webpages","archived":false,"fork":false,"pushed_at":"2025-04-02T17:23:36.000Z","size":1213,"stargazers_count":429,"open_issues_count":29,"forks_count":128,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-07-27T15:46:25.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamuelScheit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-22T00:05:19.000Z","updated_at":"2025-07-21T01:39:32.000Z","dependencies_parsed_at":"2024-06-18T13:53:30.363Z","dependency_job_id":"2bfd21e5-76d0-4cf1-8a83-d71d3fc2b620","html_url":"https://github.com/SamuelScheit/puppeteer-stream","commit_stats":{"total_commits":90,"total_committers":15,"mean_commits":6.0,"dds":0.2666666666666667,"last_synced_commit":"f24a85a15d1e2bdf19af14edc199379b6fe8e5bd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SamuelScheit/puppeteer-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelScheit%2Fpuppeteer-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelScheit%2Fpuppeteer-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelScheit%2Fpuppeteer-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelScheit%2Fpuppeteer-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelScheit","download_url":"https://codeload.github.com/SamuelScheit/puppeteer-stream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelScheit%2Fpuppeteer-stream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268456884,"owners_count":24253302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T17:20:21.252Z","updated_at":"2025-08-02T21:33:12.502Z","avatar_url":"https://github.com/SamuelScheit.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# puppeteer-stream\n\nAn Extension for Puppeteer to retrieve audio and/or video streams of a page\n\n\u003ca href=\"https://www.npmjs.com/package/puppeteer-stream\"\u003e\n\t\u003cimg src=\"https://img.shields.io/npm/v/puppeteer-stream\"\u003e\n\u003c/a\u003e\n\n## Recording video/audio from video conferencing calls\n\nIf you’re looking to use this repo to retrieve video or audio streams from meeting platforms like Zoom, Google Meet, Microsoft Teams, consider checking out [Recall.ai](https://www.recall.ai/?utm_source=github\u0026utm_medium=sponsorship\u0026utm_campaign=puppeteer-stream), an API for meeting recording.\n\n## Installation\n\n```\nnpm i puppeteer-stream\n# or \"yarn add puppeteer-stream\"\n```\n\n## Usage\n\n### Import\n\nFor ES5\n\n```js\nconst { launch, getStream } = require(\"puppeteer-stream\");\n```\n\nor for ES6\n\n```js\nimport { launch, getStream } from \"puppeteer-stream\";\n```\n\n### Launch\n\nThe method [`launch(options)`](https://github.com/SamuelScheit/puppeteer-stream/blob/main/src/PuppeteerStream.ts#L16) takes additional to the original [puppeteer launch function](https://github.com/puppeteer/puppeteer/blob/puppeteer-v20.7.2/docs/api/puppeteer.puppeteernode.launch.md), the following options\n\n```ts\n{\n\tallowIncognito?: boolean, // to be able to use incognito mode\n\tcloseDelay?: number, // to fix rarely occurring TargetCloseError, set and increase number (in ms)\n\textensionPath?: string, // used internally to load the puppeteer-stream browser extension (needed for electron https://github.com/SamuelScheit/puppeteer-stream/issues/137)\n}\n```\n\nand returns a `Promise\u003c`[`Browser`](https://github.com/SamuelScheit/puppeteer-stream/blob/beb7d50dbae8069cd7e42eb17dbe99174c56e3a6/src/PuppeteerStream.ts#L126)`\u003e`\n\n#### Headless\n\nWorks also in headless mode (no gui needed), just set `headless: \"new\"` in the [launch options](#launch)\n\n### Get Stream\n\nThe method [`getStream(options)`](https://github.com/SamuelScheit/puppeteer-stream/blob/beb7d50dbae8069cd7e42eb17dbe99174c56e3a6/src/PuppeteerStream.ts#L208) takes the following options\n\n```ts\n{\n\taudio: boolean, // whether or not to enable audio\n\tvideo: boolean, // whether or not to enable video\n\tmimeType?: string, // optional mime type of the stream, e.g. \"audio/webm\" or \"video/webm\"\n\taudioBitsPerSecond?: number, // The chosen bitrate for the audio component of the media.\n\tvideoBitsPerSecond?: number, // The chosen bitrate for the video component of the media.\n\tbitsPerSecond?: number, // The chosen bitrate for the audio and video components of the media. This can be specified instead of the above two properties. If this is specified along with one or the other of the above properties, this will be used for the one that isn't specified.\n\tframeSize?: number, // The number of milliseconds to record into each packet.\n  \tvideoConstraints: {\n\t\tmandatory?: MediaTrackConstraints,\n\t\toptional?: MediaTrackConstraints\n\t},\n\taudioConstraints: {\n\t\tmandatory?: MediaTrackConstraints,\n\t\toptional?: MediaTrackConstraints\n\t},\n}\n```\n\nand returns a `Promise\u003c`[`Readable`](https://github.com/SamuelScheit/puppeteer-stream/blob/beb7d50dbae8069cd7e42eb17dbe99174c56e3a6/src/PuppeteerStream.ts#L288)`\u003e`\n\nFor a detailed documentation of the `mimeType`, `audioBitsPerSecond`, `videoBitsPerSecond`, `bitsPerSecond`, `frameSize` properties have a look at the [HTML5 MediaRecorder Options](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder) and for the `videoConstraints` and `audioConstraints` properties have a look at the [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).\n\n## Example\n\n### [Save Stream to File:](/examples/file.js)\n\n```js\nconst { launch, getStream, wss } = require(\"puppeteer-stream\");\nconst fs = require(\"fs\");\n\nconst file = fs.createWriteStream(__dirname + \"/test.webm\");\n\nasync function test() {\n\tconst browser = await launch({\n\t\texecutablePath: \"C:/Program Files/Google/Chrome/Application/chrome.exe\",\n\t\t// or on linux: \"google-chrome-stable\"\n\t\t// or on mac: \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\n\t\tdefaultViewport: {\n\t\t\twidth: 1920,\n\t\t\theight: 1080,\n\t\t},\n\t});\n\n\tconst page = await browser.newPage();\n\tawait page.goto(\"https://www.youtube.com/embed/9bZkp7q19f0?autoplay=1\");\n\tconst stream = await getStream(page, { audio: true, video: true });\n\tconsole.log(\"recording\");\n\n\tstream.pipe(file);\n\tsetTimeout(async () =\u003e {\n\t\tawait stream.destroy();\n\t\tfile.close();\n\t\tconsole.log(\"finished\");\n\n\t\tawait browser.close();\n\t\t(await wss).close();\n\t}, 1000 * 10);\n}\n\ntest();\n```\n\n### [Stream to Discord](/examples/discord.js)\n\n### [Stream Spotify](https://www.npmjs.com/package/spotify-playback-sdk-node)\n\n### [Use puppeteer-extra plugins](/examples/puppeteer-extra.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamuelScheit%2Fpuppeteer-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamuelScheit%2Fpuppeteer-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamuelScheit%2Fpuppeteer-stream/lists"}