summaryrefslogtreecommitdiff
path: root/odin/strm/cleanup_youtube
diff options
context:
space:
mode:
Diffstat (limited to 'odin/strm/cleanup_youtube')
-rwxr-xr-xodin/strm/cleanup_youtube4
1 files changed, 3 insertions, 1 deletions
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 {
17 [[ -n "${tagFile}" ]] && rm -fv ${tagFile} 17 [[ -n "${tagFile}" ]] && rm -fv ${tagFile}
18} 18}
19 19
20urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
21
20dir=/srv/media/youtube 22dir=/srv/media/youtube
21maxsize=$((1024 * 1024 * 1024 * 50)) 23maxsize=$((1024 * 1024 * 1024 * 50))
22 24
@@ -34,7 +36,7 @@ find $dir -type d -empty -delete
34notmuch search --output=messages --format=text 'is:cached' | \ 36notmuch search --output=messages --format=text 'is:cached' | \
35 while read id; do 37 while read id; do
36 untag=false 38 untag=false
37 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) 39 url=$(notmuch show --format=raw "$id" | grep 'http://odin.asgard.yggdrasil/youtube' | sed -r 's|^.*href="http://odin.asgard.yggdrasil/youtube/([^"]+)".*$|\1|' | urldecode)
38 40
39 printf "%s\n ā€˜%sā€™\n" ${id} ${dir}/${url} 41 printf "%s\n ā€˜%sā€™\n" ${id} ${dir}/${url}
40 42