From be500c469b5a6d8999bca710665dcbfdfd96282d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 6 Apr 2018 14:21:55 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odin/strm/cleanup_youtube | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'odin/strm/cleanup_youtube') diff --git a/odin/strm/cleanup_youtube b/odin/strm/cleanup_youtube index 694487a5..2d91fe1f 100755 --- a/odin/strm/cleanup_youtube +++ b/odin/strm/cleanup_youtube @@ -17,6 +17,8 @@ function cleanup { [[ -n "${tagFile}" ]] && rm -fv ${tagFile} } +urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } + dir=/srv/media/youtube maxsize=$((1024 * 1024 * 1024 * 50)) @@ -34,7 +36,7 @@ find $dir -type d -empty -delete notmuch search --output=messages --format=text 'is:cached' | \ while read id; do untag=false - url=$(notmuch show --format=raw "$id" | grep 'http://odin.asgard.yggdrasil/youtube' | sed -r 's|^.*href="http://odin.asgard.yggdrasil/youtube/([^"]+)".*$|\1|' | sed -f /usr/lib/url_unescape.sed) + url=$(notmuch show --format=raw "$id" | grep 'http://odin.asgard.yggdrasil/youtube' | sed -r 's|^.*href="http://odin.asgard.yggdrasil/youtube/([^"]+)".*$|\1|' | urldecode) printf "%s\n ā€˜%sā€™\n" ${id} ${dir}/${url} -- cgit v1.2.3