diff options
Diffstat (limited to 'odin/strm/cleanup_youtube')
-rwxr-xr-x | odin/strm/cleanup_youtube | 4 |
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 | ||
20 | urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } | ||
21 | |||
20 | dir=/srv/media/youtube | 22 | dir=/srv/media/youtube |
21 | maxsize=$((1024 * 1024 * 1024 * 50)) | 23 | maxsize=$((1024 * 1024 * 1024 * 50)) |
22 | 24 | ||
@@ -34,7 +36,7 @@ find $dir -type d -empty -delete | |||
34 | notmuch search --output=messages --format=text 'is:cached' | \ | 36 | notmuch 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 | ||