question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

crash in AppPixivAPI.parse_qs

See original GitHub issue

for i in range(1, 200): for illust in json_result.illusts: if i is 1: json_result = aapi.illust_follow(req_auth=True) else: # get next page next_qs = aapi.parse_qs(json_result.next_url) json_result = aapi.illust_follow(req_auth=True, **next_qs)

this code runs fine for the first five but then I get json_result = aapi.illust_follow(req_auth=True, **next_qs) TypeError: illust_follow() argument after ** must be a mapping, not NoneType

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Xdynixcommented, Jan 30, 2019

It happens when there are no more pages. Try this:

from pixivpy3 import AppPixivAPI


def main():
    aapi = AppPixivAPI()
    aapi.login('username', 'password')

    next_qs = {}
    while next_qs is not None:
        json_result = aapi.illust_follow(**next_qs)
        # do something with json_result
        next_qs = aapi.parse_qs(json_result.next_url)


if __name__ == '__main__':
    main()
0reactions
Xdynixcommented, Feb 11, 2019
  1. You should not make an assumption that you can perform the iteration for 200 times. And there is no documentation mentions that json_result.next_url will not become None after reaching the last page. Using a while loop is much more safe. This is what I said “caused by your code”, they are not safe enough.

  2. Even on the desktop there is still a limit on following illustrations. For regular user the limitation is 2000, and for premium user it is 5000.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search Limits · Issue #69 · upbit/pixivpy - GitHub
Where APPAPI = AppPixivAPI. Public API: srch = PAPI.search_works("SwordArtOnline OR SAO OR ソード ... crash in AppPixivAPI.parse_qs #71.
Read more >
Cheesecake - .clue
Since switching to Pixiv as my primary 2D image source, I've been bookmarking every picture I blog. Last night, I hacked together another...
Read more >
pixivpy - bytemeta
crash in AppPixivAPI.parse_qs. ThePreviousOne. ThePreviousOne CLOSED · Updated 3 years ago · client Id. Ristellise. Ristellise CLOSED · Updated 3 years ago ...
Read more >
pixivpy from upbit - Giter Site
class AppPixivAPI(BasePixivAPI): # 返回翻页用参数 def parse_qs(next_url): # 用户详情 def user_detail(user_id): # 用户作品 ... crash in AppPixivAPI.parse_qs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found