1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-12-28 15:57:19 +00:00

Never use ao3dl; it's now just a few usefuls

This commit is contained in:
Phantop 2020-06-25 15:12:54 -04:00
parent e03f2180f9
commit 712b717b47

View file

@ -1,9 +1,17 @@
# Defined in /tmp/fish.qhqZn9/ao3dl.fish @ line 2
# Defined in /tmp/fish.gMuQkV/ao3dl.fish @ line 2
function ao3dl
set dir (sed (math (grep -n '<title>' $argv | cut -d: -f1) + 1)!d $argv | sed -e 's/^[ \t]*//')
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 ..
for i in (lynx -dump -hiddenlinks=listonly out.html | grep '\.epub' | awk 'FNR > 2 {print$2}' | grep http)
dl $i
end
for i in (find . -maxdepth 2 -printf "%f\n" | sort -f | uniq -di)
mv $i */$i
end
end