Handle playlists as well

This commit is contained in:
Nox Sluijtman 2024-07-08 11:54:18 +02:00
parent f5935177a8
commit d53dd31a76
Signed by: Egg
SSH key fingerprint: SHA256:2sG9X3C7Xvq2svGumz1/k7cm8l4G9+qAtAeugqB4J9M

View file

@ -3,7 +3,9 @@
def parse_url [url: string] { def parse_url [url: string] {
let parsed_url = $url | url parse let parsed_url = $url | url parse
if ($parsed_url.path | str contains '/watch') { let correct_string = ($parsed_url.path | grep -E "(playlist|watch)" | complete).exit_code
if ($correct_string == 0) {
if $parsed_url.host != "youtube.com" { if $parsed_url.host != "youtube.com" {
$url | str replace $parsed_url.host "youtube.com" $url | str replace $parsed_url.host "youtube.com"
} else { } else {