From e04eb710bbd01c0f6f486c037815687081c21d4b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 12 Dec 2023 00:12:10 +0100 Subject: added ytlink --- bin/common/ytlink | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/common/ytlink (limited to 'bin/common/ytlink') diff --git a/bin/common/ytlink b/bin/common/ytlink new file mode 100755 index 0000000..a5e9bf0 --- /dev/null +++ b/bin/common/ytlink @@ -0,0 +1,14 @@ +#!/bin/sh + +# convert to youtube.com/path url +# works for: +# - 'youtu.be/watch?v=xxxxxx' +# - 'https://piped.video/watch?v=xxxxx' + +inp="$1" +[ "${inp:=$(clipo)}" ] || inp="$(cat /dev/stdin)" + +# remove util scheme +inp="${inp#*//}" +inp="https://youtube.com/${inp#*/}" +printf "%s" "$inp" -- cgit v1.2.3