This script fetches the transcript of a YouTube video from the active tab in the Arc browser and copies it to the clipboard. The script logs all actions to a file, handling various scenarios like non-YouTube URLs and unavailable transcripts.
- Fetch transcript of the currently active YouTube video in Arc Browser.
- Retry fetching transcripts with available languages if the default language fails.
- Log actions and errors to
youtube-transcript.log
. - Handle invalid URLs by logging and displaying relevant messages.
- Node.js
- Arc Browser
-
Clone the Repository:
git clone https://github.com/svndco/youtube-transcript.git cd youtube-transcript
-
Install Dependencies: Ensure dependencies are installed.
npm install clipboardy axios fs-extra
-
Make the Script Executable: Make sure the script is executable.
chmod +x youtube-transcript.mjs
-
Navigate to the Script Directory:
cd /path/to/youtube-transcript/
-
Run the Script:
node youtube-transcript.mjs
-
Open Raycast: Launch the Raycast app.
-
Add Script Command:
- Go to Extensions
- Click on Script Commands
- Create a new script command with the following settings:
- Name: YouTube Transcript
- Description: Fetch transcript for the current YouTube URL in the active tab and copy it to the clipboard.
- Script Path:
/path/to/youtube-transcript.mjs
- Output: Full Output
-
Run the Script in Raycast:
- Use the Raycast shortcut to open the command palette.
- Type
YouTube Transcript
and run the script.
The script logs output to youtube-transcript.log
in the script's directory. To review the logs, use the following command:
cat /path/to/youtube-transcript/youtube-transcript.log