diff --git a/invyt.nu b/invyt.nu new file mode 100755 index 0000000..1a093a6 --- /dev/null +++ b/invyt.nu @@ -0,0 +1,18 @@ +#!/usr/bin/env nu + +def get_url [url: string] { + let parsed_url = $url | url parse + if ($parsed_url.path | str contains '/watch') { + if $parsed_url.host != "youtube.com" { + $url | str replace $parsed_url.host "youtube.com" + } else { + $url + } + } else { + "Not a YouTube/Invidious/Piped URL" + } +} + +def main [--url: string] { + yt-dlp --embed-chapters --embed-metadata --embed-subs (get_url $url) +}