Skip to content

YouTube: Add a transcript variable with linked timestamps #785

@sotayamashita

Description

@sotayamashita

Describe the solution you'd like

When taking study notes from YouTube videos, I want to click timestamps in Obsidian to jump to the corresponding position in the video.

Currently {{transcript}} outputs timestamps as plain bold text:

**0:00** · Introduction
**1:30** · Main topic
**1:01:01** · Summary

I'd like a way to get timestamps as clickable YouTube links:

[0:00](https://www.youtube.com/watch?v=VIDEO_ID&t=0s) Introduction
[1:30](https://www.youtube.com/watch?v=VIDEO_ID&t=90s) Main topic
[1:01:01](https://www.youtube.com/watch?v=VIDEO_ID&t=3661s) Summary

Possible approaches

  1. New variable in Clipper (e.g. {{transcriptLinked}}) — post-process {{transcript}} in buildVariables() to convert bold timestamps into YouTube links. {{transcript}} stays unchanged for backward compatibility.
  2. Defuddle-side change — Defuddle could output linked timestamps directly, benefiting all consumers.

Reference implementation

I prototyped approach 1: diff

Changes:

  • extractYouTubeVideoId() — extracts video ID from YouTube URLs (watch, youtu.be, embed, shorts)
  • linkTranscriptTimestamps() — converts **MM:SS** / **HH:MM:SS** to markdown links with computed seconds
  • buildVariables() — generates {{transcriptLinked}} when URL is YouTube and transcript exists
  • Registered in PRESET_VARIABLES for template validation
  • Unit and integration tests included

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions