mikf / gallery-dl

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

Is there a way to filter file size via command line #5805

Closed REMILI0 closed 3 months ago

REMILI0 commented 3 months ago

I have a file called Scrap.txt that has several lines and I use it to get the link to videos.

Scrap.txt (EXAMPLE).

https://coomer.su/onlyfans/user/twoone/post/490106354 https://coomer.su/onlyfans/user/twoone/post/565433963 https://coomer.su/onlyfans/user/twoone/post/703251841

Then I use the following command to get only video link

gallery-dl --get-urls --filter "extension not in ('jpg', 'png', 'gif')" --input-file Scrap.txt > 2b1p.txt

Is there any way via command line that I can specify to get only files up to 300Mb???

Thanks

mikf commented 3 months ago
  --filesize-max SIZE         Do not download files larger than SIZE (e.g.
                              500k or 2.5M)

so --filesize-max 300M in your case.

mikf commented 3 months ago

--get-urls

Oh. I missed that ... then no, getting the filesize without an extra HTTP request is not possible.

REMILI0 commented 3 months ago

Unfortunately It did not work I used the folllowing command

gallery-dl --get-urls --filter "extension not in ('jpg', 'png', 'gif')" --filesize-min 300M --input-file Scrap.txt > 2b1p.txt

It ignored file size and brought all the video files.

Do i have to install additional modules like ytd and have it configured? If yes, how do I do that?

mikf commented 3 months ago

--filesize-min and --filesize-max have an effect only when actually downloading files, meaning they don't work with --get-urls.

There is no real way of doing this with gallery-dl then. You could write a script that sends a HEAD request for each video to figure out its size, or the software you're going to use to download the 2b1p.txt files might have an option similar to --filesize-max.