From 34691683e3edc54b1a1278088b9823fe9cafbaca Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 27 Dec 2019 19:52:13 -0500 Subject: [PATCH] Fish: ao3dl --- .config/fish/functions/ao3dl.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .config/fish/functions/ao3dl.fish diff --git a/.config/fish/functions/ao3dl.fish b/.config/fish/functions/ao3dl.fish new file mode 100644 index 0000000..cf4be02 --- /dev/null +++ b/.config/fish/functions/ao3dl.fish @@ -0,0 +1,9 @@ +# Defined in /tmp/fish.qhqZn9/ao3dl.fish @ line 2 +function ao3dl + set dir (sed (math (grep -n '' $argv | cut -d: -f1) + 1)!d $argv | sed -e 's/^[ \t]*//') + mkdir $dir; cd $dir + for i in (grep works/[0-9]\* ../$argv -o | uniq | sed 's/works\///g' | sed '/^$/d') + dl https://download.archiveofourown.org/downloads/$i/\*.epub + end + cd .. +end