-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
I often find myself wanting to download, for example, all the but the last n files from a URL. Currently, using a negative index results in a NOP:
❯ gallery-dl --range 2:-1 -- https://imgur.com/a/TcBmP
<nothing>Working around this requires one of the following:
- Run
gallery-dl -K <URL>and check forcount, then rungallery-dl --range <RANGE> <URL>with this newly discoveredcount. This requires at least 2 requests for information that gallery-dl already knows with a single request. - Run something like
gallery-dl --filter "2 <= num <= count-1" <URL>. This requires each file to have anumequivalent, which I'm not sure is the case for all extractors. - Manually count the number of files and use this with
--range.
Ideally, a range slice should support negative indexes. If that is non-trivial to implement, providing such a range slice should result in an error instead of a NOP.