-
-
Save radjah/19cf2ba429392b91a7b3 to your computer and use it in GitHub Desktop.
thedoujin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Параметры: id_коллекции количество_страниц папка | |
# Выбираем качалку и создаём папку | |
dldr='aria2c --remote-time' | |
if [ ! -d $3 ] | |
then | |
echo Creating $3... | |
mkdir "$3" | |
else | |
dldr='wget -nc' | |
fi | |
echo Entering $3... | |
cd "$3" | |
colid=$1 | |
pages=$2 | |
# Получаем список файлов и приводим его в нужный для закачки вид | |
for ((i=1; i<=$pages; i++)) | |
do | |
curl http://thedoujin.com/index.php/categories/$colid\?Pages_page=$i|pcregrep -o -e 'data-original=\"[^\"]+'|sed -e 's/data-original="//g' -e 's/thumbnails/images/g' -e 's/thumbnail_//g' >> get.thedoujin.txt | |
done; | |
# Выкачиваем | |
$dldr -i get.thedoujin.txt | |
# Переименование | |
basename -a `cat get.thedoujin.txt`|awk -F. 'NF {printf "%s %03d.%s\n",$0, NR, $NF}'|xargs -t -l1 mv | |
# Чиста мусора | |
rm -f *.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment