Action to append timecode to YouTube URL?

I am not familiar with drafts actions, so let me know if I am speaking nonsense.

In iOS, Is it possible to code an action that:

  1. Gets a YouTube video link from the clipboard

  2. Asks the user to tap the in the video timecode

  3. Pastes it as a clickable link in the note

Here’s a YouTube timecode example:

So the code to append would be:


YouTube timecodes follow a weird fomat. When a video is under an hour long, it’s possible to use 00m00s. When it goes over an hour, it’s necessary to calculate the timecode in minutes or seconds. It’s not possible to write 00hh00mm00ss, which is quite annoying. So the cherry on top would be a calculation to devise the timecode in minutes, even when input as 00h00m00s.

If you can, let me know if this is possible and where I could start looking for putting it together!