YouTube is kind of a pain in the ass these days
This commit is contained in:
parent
999ca55f97
commit
ababcae988
18
invyt.nu
Executable file
18
invyt.nu
Executable file
|
@ -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)
|
||||
}
|
Loading…
Reference in a new issue