README file from
GithubYT links
An Obsidian plugin that makes YouTube links clean and useful — a companion to
the official Obsidian Web Clipper, which captures a video's URL into a source
property and a transcript full of unlinked time notations.
It does four things, each available as a command and (for functions 1, 2, and 4) on paste:
- Strip notification count — removes a leading count like
(58)from the title of a YouTube Markdown link. - Readable timestamps — turns a YouTube URL that carries a timestamp into
a Markdown link showing the time, e.g.
[0:56](…?t=56). - Link time notations — turns a bare
2:34/1:02:05into a link into the note's source video at that moment. - Strip hashtags — removes or defuses hashtags like
#musicin a YouTube link title, so pasted video titles don't seed the vault with foreign tags.
Each function can be toggled on or off.
Features
1. Strip notification count
A YouTube page title copied from the browser as a Markdown link often starts with a notification count:
[(62) Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) - YouTube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
becomes
[Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) - YouTube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
Only the leading count is removed — the other parenthesised parts of the title
((Official Video), (4K Remaster)) are kept. And only short counts (up to
three digits) are removed, so a title that genuinely starts with a year like
(2049) is left alone.
2. Readable timestamps
A YouTube URL with a timestamp becomes a readable link:
https://youtu.be/dQw4w9WgXcQ?list=RDdQw4w9WgXcQ&t=56
becomes
[0:56](https://youtu.be/dQw4w9WgXcQ?list=RDdQw4w9WgXcQ&t=56)
The time is read from t or start, in any of the forms YouTube accepts
(56, 56s, 1m30s, 1h2m3s). Under an hour the title is m:ss; an hour or
more, h:mm:ss.
3. Link time notations
Turns bare time notations in the note body into links into the note's source
video. The video URL is read from a frontmatter property (default source),
which may be a raw URL or a Markdown link:
source: https://youtu.be/dQw4w9WgXcQ
Then 2:34 becomes [2:34](https://youtu.be/dQw4w9WgXcQ?t=154).
Only valid clock times are linked (minutes and seconds 0–59), so scores like
75:68, one-digit forms like 1:5, and ISO datetimes are skipped. Notations
inside markup are linked while the markup is kept: **2:34** →
**[2:34](…)**. Nothing inside frontmatter, code, existing links, wikilinks,
or URLs is touched, and running a command twice never double-links.
If the source property is missing or isn't a YouTube URL, or no notations are found, the plugin tells you and stops.
4. Strip hashtags
Creators often pack hashtags into a video title. Copied into a note, they clutter the link and can seed your vault with foreign tags:
[Live at Montreux #jazz #live-set - YouTube](https://youtu.be/dQw4w9WgXcQ)
Two ways to handle them, chosen in settings:
- Replace # character (default) — swaps only the
#for a character of your choice (default-, or leave the field empty to drop just the#), keeping the word:#jazz→-jazz. - Remove entire hashtag — drops the whole
#jazzand tidies the leftover spacing.
A hashtag is recognised the same way Obsidian recognises a tag: a # at the
start of the title or after a space, followed by letters, digits, _, -, or
/, with at least one letter. So #4k and #live-set are handled, while C#,
a purely numeric #2049, and a lone # are left alone.
How each command decides what to convert
Each command scopes its work to what you're pointing at, with more warning for bigger changes:
- On paste (functions 1, 2, and 4): converts automatically and shows a notice of what changed.
- Text selected: converts everything in the selection after a brief confirmation.
- No selection, cursor inside a target: converts just that one, no confirmation.
- No selection, cursor elsewhere: offers to convert the whole note after a warning.
Settings
- Toggles to turn each of the four functions on or off.
- YouTube URL property — the frontmatter property that holds the video URL
for function 3 (default
source). - Hashtag handling — for function 4, whether to replace only the
#(with a character of your choice, default-) or remove the entire hashtag.
Installing from Community Plugins (recommended)
- Open Settings → Community plugins and make sure Restricted mode is off.
- Click Browse, search for YT links, and click Install.
- Click Enable.
Installing with BRAT (for pre-release testing)
BRAT installs and auto-updates in-development builds straight from a GitHub repo:
- Install the BRAT plugin from the Obsidian Community Plugins store and enable it.
- Go to Settings → Community plugins → BRAT.
- Click Add beta plugin.
- Paste this repository URL:
https://github.com/Quietbyday/obsidian-yt-links - Click Add plugin.
- Enable YT links in Settings → Community plugins.
To update later, open BRAT and click Check for updates (or just restart Obsidian).
Installing manually
- Build
main.jswithnpm installthennpm run build, or downloadmain.jsandmanifest.jsonfrom a release. - Copy
main.jsandmanifest.jsoninto<Vault>/.obsidian/plugins/yt-links/. - Reload Obsidian and enable YT links in Settings → Community plugins.
Changelog
1.0.1
Maintenance release addressing the community-store audit. No user-facing
behavior changes: replaced the builtin-modules build dependency with Node's
native module.builtinModules, and tightened two any-typed reads (frontmatter
property lookup and saved-settings load) to satisfy the type checker.
1.0.0
First public release on the Obsidian community store. No functional changes from
0.3.0-beta — the four commands (strip notification count, readable timestamps,
link time notations, strip hashtags) and their paste/selection/cursor/whole-note
behavior are unchanged.
0.3.0-beta
Fixes the strip-hashtags notice, which counted a link with several hashtags as just "1 hashtag". It now reports the number of links cleaned — e.g. "Cleaned 1 hashtagged link" — which is accurate however many hashtags a title holds.
Adds an opt-in Debug logging setting (off by default). When on, the paste handler logs to the developer console what it sees — including whether another plugin already handled the paste — which makes conflicts with other paste plugins easy to track down.
0.2.0-beta
Adds strip hashtags (function 4): removes or defuses hashtags like #music
in a YouTube link title, using Obsidian's own tag rules so C# and years like
#2049 are left alone. Choose between replacing just the # (default -) or
removing the whole hashtag. Runs on paste alongside strip-count and as its own
command.
0.1.0-beta
Initial beta. Three commands — strip notification count, readable timestamps, link time notations — each with the paste / selection / cursor / whole-note activation cascade. Region-aware safety (skips frontmatter, code, links, wikilinks, URLs), valid-clock-time checking, and idempotent conversions.