1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-11-27 00:53:17 +00:00

Move ao3dl from fish to two bash scripts

This commit is contained in:
Phantop 2020-08-21 15:12:16 -04:00
parent f4e3943190
commit 355f55f28c
3 changed files with 10 additions and 16 deletions

View file

@ -1,16 +0,0 @@
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 ..
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

5
.local/bin/ao3.1 Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
for i in $(grep works/[0-9]\* $@ -o | uniq | sed 's/works\///g' | sed '/^$/d')
do
aria2c https://download.archiveofourown.org/downloads/$i/\*.epub
done

5
.local/bin/ao3.2 Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
for i in $(lynx -dump -hiddenlinks=listonly $@ | grep '\.epub' | awk 'FNR > 2 {print$2}' | grep http)
do
aria2c $i
done