Skip to content

Commit

Permalink
feat: Add illust_new for #189, bump version to v3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao Zhou committed Nov 6, 2021
1 parent a55c6a9 commit 024d4e7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,21 @@ class AppPixivAPI(BasePixivAPI):

# 获取ugoira信息
def ugoira_metadata(self, illust_id):

# 用户小说列表
def user_novels(self, user_id, filter='for_ios', offset=None):

# 小说系列详情
def novel_series(self, series_id, filter='for_ios', last_order=None):

# 小说详情
def novel_detail(self, novel_id):

# 小说正文
def novel_text(self, novel_id):

# 大家的新作 [illust, manga]
def illust_new(self, content_type="illust", filter='for_ios', max_illust_id=None):
~~~

[Usage](https://github.com/upbit/pixivpy/blob/master/demo.py#L42):
Expand Down
2 changes: 1 addition & 1 deletion pixivpy3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Pixiv API library
"""
__version__ = '3.6.0'
__version__ = '3.6.1'

from .papi import PixivAPI
from .aapi import AppPixivAPI
Expand Down
11 changes: 11 additions & 0 deletions pixivpy3/aapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,17 @@ def novel_text(self, novel_id, req_auth=True):
r = self.no_auth_requests_call('GET', url, params=params, req_auth=req_auth)
return self.parse_result(r)

# 大家的新作
## content_type: [illust, manga]
def illust_new(self, content_type="illust", filter='for_ios', max_illust_id=None, req_auth=True):
url = '%s/v1/illust/new' % self.hosts
params = {
'content_type': content_type,
'filter': filter,
}
r = self.no_auth_requests_call('GET', url, params=params, req_auth=req_auth)
return self.parse_result(r)

# 特辑详情 (无需登录,调用Web API)
def showcase_article(self, showcase_id):
url = 'https://www.pixiv.net/ajax/showcase/article'
Expand Down

2 comments on commit 024d4e7

@potpotkettle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to set max_illust_id in params. content_type and filter are set, but max_illust_id is missing.

With any max_illust_id given to illust_new, I get the same results.

@upbit
Copy link
Owner

@upbit upbit commented on 024d4e7 Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to set max_illust_id in params. content_type and filter are set, but max_illust_id is missing.

With any max_illust_id given to illust_new, I get the same results.

Fixed in https://pypi.org/project/PixivPy/3.6.2/

Please sign in to comment.