Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle pagination #4

Open
eight04 opened this issue Nov 20, 2019 · 0 comments
Open

Handle pagination #4

eight04 opened this issue Nov 20, 2019 · 0 comments

Comments

@eight04
Copy link

eight04 commented Nov 20, 2019

It is often that we have to grab multiple pages to get all images. With the current hook get_chapter_files, we have to implement something like this:

page_url = chapter.url
count = 0
while True:
  content = self.request.get(page_url)
  # parse content and find image links
  for url in urls:
    yield Image(...)
    count += 1
  # parse content and find next page
  if not next_page_url:
    break
  page_url = next_page_url

The problem is that you always have to start from the first page. I want to allow users to pause the download process, save the process to the disk, restart the application, load the process and continue.

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

No branches or pull requests

1 participant