1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-12-27 07:26:43 +00:00
dotfiles/fish/functions/ao3.fish

9 lines
403 B
Fish
Raw Normal View History

function ao3
grep works/.\*/b $argv | cut -d/ -f3 | uniq | parallel curl -OJL ao3.org/downloads/{}/1.epub
for i in *.epub
2023-06-03 16:00:25 +00:00
set title (tar Oxf $i content.opf | pup | grep -A1 -m1 dc:title | tail -1 | sed 's/^ *//' | tr -d /)
set creator (tar Oxf $i content.opf | pup | grep -A1 -m1 dc:creator | tail -1 | sed 's/^ *//' | tr -d /)
mv $i "$creator - $title.epub"
end
end