added support for embed Youtube-URLs to youtube_resolve.sh

This commit is contained in:
tke
2019-10-29 19:25:22 +01:00
parent 674210a036
commit 0f4540b561

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
url=$(echo -ne "${*}" | grep -Pio -m1 'https://www.youtube.com/watch\?[^&|]+') url=$(echo -ne "${*}" | grep -Pio -m1 'https://www.youtube.com/(watch\?[^&|]+|embed/[^?/,|]+)')
title=$(wget -q -O- "${url}" | grep -Po "(?<=title>).*(?=</title)") title=$(wget -q -O- "${url}" | grep -Po "(?<=title>).*(?=</title)")
title_parsed=$(cat <<eof | python3 title_parsed=$(cat <<eof | python3
from urllib.parse import unquote from urllib.parse import unquote