Skip to content

YouTube transcription variable #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dpigera
Copy link
Contributor

@dpigera dpigera commented Feb 16, 2025

Summary

This PR addresses introducing a transcript variable that pulls down transcripts via the YouTube template
Issue link: #274

Changes Introduced:

  • Added a getTranscript() method to utils/extractors/youtube.ts which pulls the transcript lines from ytd-transcript-segment-renderer and adds the timestamp, timestamp_link, and caption text
  • Introduced a transcript variable
  • Also introduced a method to auto-click the 'Show Transcript' button. Unsure if this is a good user experience. Open to refactoring according to product needs

Testing Done

  • Compiled and ran web clipper in Safari Extensions developer mode
  • Opened YouTube video
  • Opened Settings, Templates, Added JSON from youtube.json template file
  • Added {{transcript}} variable
  • Clicked 'Show Transcript' button, and ran clipper
  • Transcript included. Example pull:
![How to Reclaim Your Life From Work | Simone Stolzoff | TED](https://www.youtube.com/watch?v=cfKFbh8LPvU)

[0:04](https://youtube.com/watch?v=cfKFbh8LPvU&t=4s) I once met this Chilean guy at a hostel.
[0:08](https://youtube.com/watch?v=cfKFbh8LPvU&t=8s) "So what do you do?" I asked him.
[0:11](https://youtube.com/watch?v=cfKFbh8LPvU&t=11s) "You mean for work?"

Screenshot

Screenshot 2025-02-16 at 1 22 20 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant