This application uses Playwright to open a web page, click a play button, and capture audio from the page.
- Install dependencies:
npm install
npm run install-browsersRun the application:
npm startThe app will:
- Open the specified Google Drive URL
- Click the play button (class: VYBDae-Bz112c-RLmnJb)
- Capture audio for 10 seconds
- Save the audio to
captured_audio.webm
Edit index.js to customize:
TARGET_URL: The URL to openPLAY_BUTTON_CLASS: The class name of the play button- Recording duration (currently set to 10 seconds in the setTimeout call)
- The browser launches in non-headless mode by default so you can see what's happening
- Audio is captured using the Web Audio API from media elements on the page
- If the play button class doesn't match, the script will try alternative selectors
- The captured audio is saved as a WebM file
If audio capture doesn't work:
- Make sure the page has audio/video elements playing
- Check browser console for errors (visible in non-headless mode)
- Try adjusting the wait times if the page loads slowly
- Ensure the play button selector is correct