# \[Plugins Required\] Copy and Clean Video Transcripts

**URL:** <https://forum.obsidian.md/t/plugins-required-copy-and-clean-video-transcripts/118043>\
**Category:** Workflows & Templates\
**Created:** [September 7, 2026, 1:42am UTC](https://forum.obsidian.md/t/plugins-required-copy-and-clean-video-transcripts/118043 "2026-09-07T01:42:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RumiaKit](https://forum.obsidian.md/user_avatar/forum.obsidian.md/rumiakit/32/81882_2.png) [@RumiaKit](https://forum.obsidian.md/u/RumiaKit)\
**Post date:** [September 7, 2026, 1:42am UTC](https://forum.obsidian.md/t/plugins-required-copy-and-clean-video-transcripts/118043/1 "2026-09-07T01:42:00Z")

</div>

> ## Disclaimer
> 
> Is this project **open source**? Yes  
> Is this project completely **free**? Yes  
> Is this project made with AI beyond the author’s ability to comprehend how it works? No

* * *

Ever wanted to copy a video transcript from `YouTube` into your vault so that you could archive a specific section, quote, or maybe just the entire thing because the creator’s entire video was so informative?

> _TIP:_ If you’re a Firefox user, extensions exist (I can’t validate their safety at all; this is not an advertisement) so you don’t have to drag your cursor from start to end; I use `YouTube Transcript Copier` by Dislike Lever.

# Showcase

1. _STEP 1:_ Go to my other post and follow the instructions to fix the disjoint paste from YouTube transcripts: [https://forum.obsidian.md/t/plugins-required-fixing-disjoint-line-breaks-in-pdfs-when-copying-text/118042](https://forum.obsidian.md/t/plugins-required-fixing-disjoint-line-breaks-in-pdfs-when-copying-text/118042)
2. _STEP 2:_ Install the `QuickAdd` plugin (and maybe the `Editing Toolbar` plugin if you have a lot of scripts/don’t remember what they all are).
3. _STEP 3:_ Copy the script at the bottom of this post. Add it to `User Plugins`.
4. _STEP 4:_ Create a `QuickAdd Macro` to `User Plugins: Paste & Normalize`, then wait some milliseconds (I set it to 1,000, though that’s overkill), and then to run the new script `User Plugins: Clean Video Transcript`. Call it whatever, though I named it `Paste Video Transcript` for a generic name.

```js
/* Transcripts: Removes timestamps/filler words/repetition, adds capitalization */

plugin.addCommand({
    name: 'Clean Video Transcript',
    id: "clean-video-transcript",
    callback: async () => {
        const activeView = app.workspace.activeLeaf.view;
        const editor = activeView.editor;
        let corrected = await editor.getSelection();

        if (!corrected) {
            window.alert("No text in selection");
            return;
        }
        
        // PART 1: Remove timestamps
        corrected = corrected.replace(/(\n- )*([\s?!.,;…])*(\s*?)(\([0-9]+(:[0-9]+)+\))(\s*)/g, "$1$2");
        corrected = corrected.replace(/(\n- )*([\s?!.,;…])*(\s*?)([0-9]+(:[0-9]+)+((,|\s)*[0-9]+ (minute|second|hour)(s*))*)(\s*)/g, "$1$2");

        // PART 2: Remove "uh" and [music]
        corrected = corrected.replace(/(^|[^A-Za-z0-9])((U|u)h|(U|u)m|(Y|y)ou know)([,]*)(\s*)/g, "$1");
        corrected = corrected.replace(/(\[(M|m)usic\])(\s*)/g, "");
        corrected = corrected.replace(/(\[\s*__\s*\])/g, "\\[expletive\\]");

        // PART 3: Capitalize properly
        let re = /([?!.…]\s|\n- )[a-z]/g;
        corrected = corrected.replace(re, function(x){ return x.toUpperCase(); });

        // PART 4: Remove repetition (2x words)
        corrected = corrected.split(" ");
        let corrected2 = [];
        while(corrected.length > 0) {
            let c = corrected.shift();
            if(corrected2.length == 0 || !(c.toUpperCase() === corrected2[corrected2.length - 1].toUpperCase())) { corrected2.push(c); }
        } 
        corrected2 = corrected2.join(" ")

        editor.replaceSelection(corrected2);
    }
});

```
