Skip to content

Conversation

@thatDudo
Copy link
Contributor

It seems it wasnt possible to download just the last pages of each chapter.
I have looked through the code and the main difficulty is that _kwdict["count"] is not always defined if the chapter extractor is returning an iterator rather than a list.
If that is the case, it will treat -n:-m as (0,sys.maxsize).

If you want I can cache some of the results rather than recalculating them on each call.

Fixes #5402

@thatDudo
Copy link
Contributor Author

I suppose it might have been possible to do this with filter predicates by using page and count.

@mikf
Copy link
Owner

mikf commented Jun 2, 2025

Another problem is that count does not always represent the total number of files. For other sites, e.g. Twitter / Instagram / anything with posts, it is used for the number of files per post.

It also doesn't work for --chapter-range, as it might represent the count value of the current chapter and not the total number of chapters.

We should introduce a new field that either holds the total number of files / items (total, count_total ?) or a boolean value indicating if count can be used as total number of items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support negative indexes in --range slices

2 participants