YouTube video to .txt transcript extraction Shortcut via .srt (subtitles) file download

I have been experimenting with a Shortcut for extracting&capturing a cleaned plain text transcript of a YouTube video for notetaking purposes and personal use of instructional videos… (nothing that isn’t already available in English or auto-generated subtitles)
My current approach is working, which uses Run Shell Script actions and the Homebrew package yt-dlp (as a prerequisite) to extract the .srt subtitles file… which can be with English subs or auto-generated depending on flags passed in that script, so I could ideally get more sophisticated to check which are available conditionally somehow or try the auto-generated if the english fails somehow, 𝔢․𝔤․ 
 yt-dlp --write-subs --sub-langs en --skip-download --no-keep-video --convert-subs srt "YouTubeVideoURL"
🆚
yt-dlp --write-auto-subs --sub-langs en --skip-download --convert-subs srt "YouTubeVideoURL"

Then I run a deduplication and cleanup Shell script to create cleaner paragraphs, eliminate some undesirable artifacts of the auto transcripts that are not part of substantive text, 𝘦𝘵𝘤․ (I’m sure this could be done better even with Shell and improved by a more skilled scripter even without involving any LLM)… However, my initial approach was to do this with the Use Model ChatGPT action which would be more flexible and less deterministic (so was wondering if anyone would have a way to split longer transcripts into chunks and use that for smarter extract avoiding the context window limits which cut it off in the case of longer videos). The local model has a very short context, but I guess if chunking it up anyway and repeating over each part, maybe that would be preferable for privacy?

Anyway, I figured some people in this community might be interested in iterating on it, and if anyone wants to create a better version that can break up the deduped .srt file text extract that it Downloads into chunks and then run those through an 𝐀․𝐈․ cleanup pass then put it back together, I would appreciate a share on that augmentation or alternate version!

So far, I did add some basic conditionals and REGEX so it will error out and quit in case of no valid YouTube URL on clipboard or share input when it runs, but would need to do more conditionals to add alternative save locations for mobile or iPad versus desktop (currently it is hardcoded to the ~/Downloads directory, but I did try to lay some groundwork with variables that could set that more dynamically depending on device)…
It also does grab the YouTube video title for use as a filename.
If preferred, you could also delete that part and check the box to ask where to save the file every time if you wanted to simplify it… (my goal is to keep it automated and to ideally be able to change the destination directory in a dedicated variable clearly marked in the shortcut if desired, with perhaps another variable added later for  𝑖𝙾𝚂📱 or 𝑖Pad directory destinations)
Anyway, I’d appreciate any feedback or improvement suggestions!

If you’re a PKM notetaking enthusiast or autodidact like me or at all working in tech, I think it should be obvious there are a lot of uses for a text capture Shortcut like this, as there is a lot of useful or interesting information on YouTube.
https://www.icloud.com/shortcuts/8754756bf3cb4cbfa1ce0ab92e8109e0