mirror of
https://github.com/Phantop/dotfiles
synced 2024-12-26 15:06:50 +00:00
9 lines
403 B
Fish
9 lines
403 B
Fish
function ao3
|
|
grep works/.\*/b $argv | cut -d/ -f3 | uniq | parallel curl -OJL ao3.org/downloads/{}/1.epub
|
|
for i in *.epub
|
|
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
|