mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.9k stars 889 forks source link

[reddit] Download number of files then stopped #4462

Open OriginOfAbsolution opened 11 months ago

OriginOfAbsolution commented 11 months ago

How do you download the number of files and then stop? Not just for downloading reddit but for everything else.

I'm aware of a case in which the downloader stopped after the number of files skipped. But I want to do that for downloading files that haven't been downloaded before (I'm using an archive, so it's recorded).

For now, I'm using --range but I want the way that tells the downloader to download (i.e. 100 files) and then stop.

Thanks

Hrxn commented 11 months ago

So, basically: abort after num # of downloads, instead of abort after num # of skips?

OriginOfAbsolution commented 11 months ago

So, basically: abort after num # of downloads, instead of abort after num # of skips?

Yes. Right now, If I don't use --range, I will abort it manually (when there are enough files that I want at a time).

mikf commented 11 months ago

Not possible with gallery-dl alone.

Files from external URLs (imgur, redgifs, …) don't count towards the top-level --range but instead have their own --range counter.

You could possibly run gallery-dl in a shell script and count the number of outputted lines in there to kill the process when it reaches the number you want.