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

illust_comments() responds with 404 #349

Open
nautics889 opened this issue Apr 7, 2024 · 3 comments
Open

illust_comments() responds with 404 #349

nautics889 opened this issue Apr 7, 2024 · 3 comments

Comments

@nautics889
Copy link
Contributor

Context:

Python 3.11.4
PixivPy 3.7.5

Steps to reproduce

  1. Run demo.py: python ./demo.py
  2. Error occurs when calling aapi.illust_comments(59580629).

Description

There in illust_comments() method, self.no_auth_requests_call(...) seems to be returning Response [404].

Local context:

In[4]: url
Out[4]: 'https://app-api.pixiv.net/v1/illust/comments'
In[5]: params
Out[5]: {'illust_id': 59580629}  # this one from demo.py, but there can be any other
In[6]: req_auth
Out[6]: True

...and my headers when calling self.requests_call(...)

In[11]: headers_
Out[11]: {'Authorization': 'Bearer ***',
 'app-os': 'ios',
 'app-os-version': '14.6',
 'user-agent': 'PixivIOSApp/7.13.3 (iOS 14.6; iPhone13,2)'}

I believe it'd be worth checking if /v1/illust/comments is still available, probably.

@upbit
Copy link
Owner

upbit commented Apr 7, 2024

Thank you for submitting the MR, and point out the issue in the /v1/illust/comments.

I will review it as soon as possible and attempt to fix the problems.

@xiyihan0
Copy link
Contributor

xiyihan0 commented Apr 23, 2024

It seems that this API have moved to:/v3/illust/comments. This API is used in the newest version of Pixiv APP, but it has modified the data format compared to /v1/novel/comments:

res_illust_comments = api.illust_comments(112518890) #modified to /v3/illust/comments
print(res_illust_comments)

The output:

{'comments': [{'id': 175138655,
   'comment': '',
   'date': '2024-04-21T01:13:02+09:00',
   'user': {'id': 104906901,
    'name': '片神',
    'account': 'user_uaud2225',
    'profile_image_urls': {'medium': 'https://s.pximg.net/common/images/no_profile.png'}},
   'has_replies': False,
   'stamp': {'stamp_id': 304,
    'stamp_url': 'https://s.pximg.net/common/images/stamp/generated-stamps/304_s.jpg?20180605'}},
  {'id': 172222064,
   'comment': '舌头怎么会起泡呢?(heaven)',
   'date': '2024-02-29T19:35:02+09:00',
   'user': {'id': 53603145,
    'name': '落痕',
    'account': 'user_ppca3242',
    'profile_image_urls': {'medium': 'https://i.pximg.net/user-profile/img/2022/04/09/15/43/20/22523559_58cee495392fa3642588b8b60608be37_170.png'}},
   'has_replies': False,
   'stamp': None},
  {'id': 168526698,
   'comment': '(excited3)(excited3)',
   'date': '2023-12-27T03:31:15+09:00',
   'user': {'id': 38047701,
    'name': '熵玄',
    'account': 'zmr0911',
    'profile_image_urls': {'medium': 'https://i.pximg.net/user-profile/img/2023/05/04/22/16/01/24377699_a7c5db9504b715c19df387ba66f804cb_170.png'}},
   'has_replies': False,
   'stamp': None},
  ...],
 'next_url': None,
 'comment_access_control': 0}

@xiyihan0
Copy link
Contributor

And if you want to get the replies of a certain comment, you must call v2/illust/comments/replies?comment_id=...&offset=...

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

No branches or pull requests

3 participants