diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-06 14:21:55 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-06 14:21:55 +0200 |
commit | be500c469b5a6d8999bca710665dcbfdfd96282d (patch) | |
tree | e830f2809fb528aecf5f4ded7b7d658a4f96370e | |
parent | a8d02267bcaeb90e9933b63c666bf693158da154 (diff) | |
download | nixos-be500c469b5a6d8999bca710665dcbfdfd96282d.tar nixos-be500c469b5a6d8999bca710665dcbfdfd96282d.tar.gz nixos-be500c469b5a6d8999bca710665dcbfdfd96282d.tar.bz2 nixos-be500c469b5a6d8999bca710665dcbfdfd96282d.tar.xz nixos-be500c469b5a6d8999bca710665dcbfdfd96282d.zip |
…
-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 | ||