1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-09-19 16:39:00 +00:00
dotfiles/.config/fish/functions/ao3dl.fish
2019-12-27 19:52:13 -05:00

10 lines
365 B
Fish

# Defined in /tmp/fish.qhqZn9/ao3dl.fish @ line 2
function ao3dl
set dir (sed (math (grep -n '<title>' $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