Closed JacobDreiling closed 1 year ago
You could possibly use the number of downloaded favorites to get the next index for --range
.
last_index=$(ls -1 /path/to/target/directory | wc -l)
gallery-dl <site> -c "conf.txt" --range "$last_index-"
Am I not running
--exec
correctly?
Possibly, but I don't really know to be honest. All I can tell you is that ((last_index++));
doesn't seem to have an effect on the value of last_index
here. Maybe because it runs in a sub-shell that doesn't propagate the value to its parent?
Sorry for the delay. Your suggestion would work except if any previous images are deleted, as that throws off the count. Also, I just saw that --range
doesn't work beyond the first page anyway.
Given how limited gelbooru is, I think the only way to make this work is by extracting the last few dozen links using beautiful soup. So maybe this problem is outside the scope of gallery-dl.
Also, I just saw that
--range
doesn't work beyond the first page anyway.
Fixed in https://github.com/mikf/gallery-dl/commit/068aa26c3eaca1bac57f6dc0352bdc26585876f2.
Much appreciated! I will be using something like --range "$((last_index-10))-"
so I don't miss any new images, in case any previous images were deleted in the gallery.
I think I can use -g
or -G
to record the number of images that were skipped or downloaded in that range. Which one would be better in this case?
Using -g
or -G
doesn't make a difference for Gelbooru v0.1.11 sites. It only matters when child extractors are involved, which is not the case here.
I understand, thanks for clearing that up! With --range
working, I think this issue is solved now.
On the gelbooru site I'm downloading from, the favorites are listed from oldest to newest added. I tried keeping track of the last downloaded index to use in
--range
but it isn't being updated after--exec
:Am I not running
--exec
correctly? Also, is there a more practical way to get the latest favorites with the v0.1 favorites extractor?