Quickadd note with YouTube metadata and media extended

Hi all! I want to streamline my note taking on YouTube videos.

Goal: with a YouTube URL in the system clipborad I want to use that URL and nothing more to be able to generate a new note with title as the YouTube title, some metadata such as author and channel in the frontmatter. Then I want to use the URL to define an iframe because it looks nice and finally use the URL again to start ‘Media Extended’ to start watching the YouTube video and taking notes.

Somehow ambitios, but I think it should be possible to do this with a mix of QuickAdd, Templater and Media Extended. My idea is the following:

  1. use quickadd plugin to run a script (located in some folder, e.g. Script) to get YouTube metadata given the link from the clipboard. See inspiration below:
  2. use data from the script above to be referenced in a templater template for frontmatter and title to a note.
    3: use URL to start Media Extended.

But I am stuck already at the first step. I don’t know how to properly run a script to grab the system clipboard and then return YouTube metadata so that it is possible to use it in step 2 and 3.

Ideas and suggestions are more than welcome! I believe this could be very useful for many people!


URL from clipboard
let url = await tp.system.clipboard();

Metadata from YouTube:
const data = await requestUrl({ url: 'https://youtube.com/oembed?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&format=json' })


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.