Ratelimits... :-(, fixed extra download
This commit is contained in:
parent
58763f5bf3
commit
7c1ff29270
|
@ -19,12 +19,12 @@ function getnhentai {
|
||||||
local types=($(print $pageinfo | jq -r '.types[]'))
|
local types=($(print $pageinfo | jq -r '.types[]'))
|
||||||
local num_pages=$(print $pageinfo | jq '.pages')
|
local num_pages=$(print $pageinfo | jq '.pages')
|
||||||
local urls=()
|
local urls=()
|
||||||
for i in {0..$num_pages}; do
|
for i in {1..$num_pages}; do
|
||||||
local itoc=$(($i + 1))
|
local ctoi=$(($i - 1))
|
||||||
[[ ${types[$i]} == p ]] && local type=png || local type=jpg
|
[[ ${types[$ctoi]} == p ]] && local type=png || local type=jpg
|
||||||
urls+=("https://i.nhentai.net/galleries/$media_id/$itoc.$type")
|
urls+=("https://i.nhentai.net/galleries/$media_id/$i.$type")
|
||||||
done
|
done
|
||||||
curl -\#ZL --remote-name-all ${urls}
|
curl --retry 10 -\#L --remote-name-all ${urls}
|
||||||
for i in *; do
|
for i in *; do
|
||||||
local sortname="$(printf "%.3i" "${i%%.*}").${i##*.}"
|
local sortname="$(printf "%.3i" "${i%%.*}").${i##*.}"
|
||||||
[ $sortname = $i ] || mv $i $sortname
|
[ $sortname = $i ] || mv $i $sortname
|
||||||
|
|
Loading…
Reference in New Issue