azuline / pixiv-api

A documented, idiomatic, and tested wrapper library around Pixiv's App API.

Home Page:https://pixiv-api.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code block in the documentation

7274 opened this issue · comments

commented

Hello! Sorry in advance if I'm wrong, but this code block in the documentation doesn't seem to work with profiles with small amount of illustrations, for example this profile
Here is the code i've used, copypasted everything from man except id, login and a folder
Also tried the same code with different id, worked perfectly

from pathlib import Path
from pixivapi import Size
from pixivapi import Client

client = Client()
client.login("****","*****")

artist_id = 14080533
directory = Path.home() / 'Boo'

response = client.fetch_user_illustrations(artist_id)
while response['next']:
    for illust in response['illustrations']:
        illust.download(directory=directory, size=Size.ORIGINAL)

    if response['next']:
        response = client.fetch_user_illustrations(
            artist_id,
            offset=response['next'],
        )

Thanks for pointing this out. The code was not correct, and a fixed example has been pushed to the README and documentation.