@@ -2,6 +2,7 @@ PixivPy [](https://travi
2
2
======
3
3
_ Pixiv API for Python (with Auth supported)_
4
4
5
+ * [ 2017/01/05] Add ` AppPixivAPI().illust_detail() ` to like ` PixivAPI().works() ` (thanks [ Mapaler] ( https://github.com/Mapaler ) ), release v3.3
5
6
* [ 2016/12/17] Fixed encoding BUG for Public-API, see #26 (thanks [ Xdynix] ( https://github.com/Xdynix ) )
6
7
* [ 2016/07/27] Now ` AppPixivAPI() ` can call ** without auth** (thanks [ zzycami] ( https://github.com/zzycami ) ), check [ demo.py] ( https://github.com/upbit/pixivpy/blob/b83578e066ddcba86295676d931ff3313d138b22/demo.py#L268 )
7
8
* [ 2016/07/20] New ** App-API** (Experimental) for ` PixivIOSApp/6.0.9 `
@@ -22,25 +23,29 @@ Requirements: [requests](https://pypi.python.org/pypi/requests)
22
23
### Example:
23
24
24
25
~~~ python
25
- from pixivpy3 import *
26
-
27
- api = PixivAPI()
28
- api.login(" username" , " password" )
26
+ api = AppPixivAPI()
27
+ # api.login("username", "password") # Not required
29
28
30
29
# get origin url
31
- json_result = api.works(45455208 )
32
- illust = json_result.response[0 ]
33
- print (" origin url: %s " % illust.image_urls[' large' ])
34
-
35
- # get ranking (page1)
36
- json_result = api.ranking_all(' daily' )
37
- ranking = json_result.response[0 ]
38
- for illust in ranking.works:
39
- print (" [%s ] %s " % (illust.work.title, illust.work.image_urls.px_480mw))
30
+ json_result = api.illust_detail(59580629 )
31
+ illust = json_result.illust
32
+ print (" >>> origin url: %s " % illust.image_urls[' large' ])
33
+
34
+ # get ranking: 1-30
35
+ # mode: [day, week, month, day_male, day_female, week_original, week_rookie, day_manga]
36
+ json_result = api.illust_ranking(' day' )
37
+ for illust in json_result.illusts:
38
+ print (" p1 [%s ] %s " % (illust.title, illust.image_urls.medium))
39
+
40
+ # next page: 31-60
41
+ next_qs = api.parse_qs(json_result.next_url)
42
+ json_result = api.illust_ranking(** next_qs)
43
+ for illust in json_result.illusts:
44
+ print (" p2 [%s ] %s " % (illust.title, illust.image_urls.medium))
40
45
~~~
41
46
42
- ### [ Sniffer - Public API] ( https://github.com/upbit/pixivpy/wiki/sniffer )
43
47
### [ Sniffer - App API] ( https://github.com/upbit/pixivpy/wiki#6x-api )
48
+ ### [ Sniffer - Public API] ( https://github.com/upbit/pixivpy/wiki/sniffer )
44
49
45
50
### [ Using AppPixivAPI() to download illusts (without auth)] ( https://github.com/upbit/pixivpy/blob/master/download_illusts.py#L24 )
46
51
@@ -86,9 +91,9 @@ Find Pixiv API in **Objective-C**? You might also like [**PixivAPI_iOS**](https:
86
91
87
92
~~~ python
88
93
class AppPixivAPI (BasePixivAPI ):
89
- """
90
- Warning: The AppPixivAPI backend is experimental !!!
91
- """
94
+
95
+ # 返回翻页用参数
96
+ def parse_qs ( self , next_url ):
92
97
93
98
# 用户详情 (无需登录)
94
99
def user_detail (self , user_id ):
@@ -99,23 +104,26 @@ class AppPixivAPI(BasePixivAPI):
99
104
# 用户收藏作品列表 (无需登录)
100
105
def user_bookmarks_illust (self , user_id , restrict = ' public' ):
101
106
102
- # 作品排行
103
- # mode: [day, week, month, day_male, day_female, week_original, week_rookie, day_manga]
104
- # date: '2016-08-01'
105
- # mode(r18榜单需登录): [day_r18, day_male_r18, day_female_r18, week_r18, week_r18g]
106
- def illust_ranking (self , mode = ' day' , date = None , offset = None ):
107
-
108
107
# 关注用户的新作
109
108
# restrict: [public, private]
110
109
def illust_follow (self , restrict = ' public' ):
111
110
111
+ # 作品详情 (无需登录,同PAPI.works)
112
+ def illust_detail (self , illust_id ):
113
+
112
114
# 相关作品列表 (无需登录)
113
115
def illust_related (self , illust_id ):
114
116
115
117
# 插画推荐 (Home - Main) (无需登录)
116
118
# content_type: [illust, manga]
117
119
def illust_recommended (self , content_type = ' illust' ):
118
120
121
+ # 作品排行
122
+ # mode: [day, week, month, day_male, day_female, week_original, week_rookie, day_manga]
123
+ # date: '2016-08-01'
124
+ # mode(r18榜单需登录): [day_r18, day_male_r18, day_female_r18, week_r18, week_r18g]
125
+ def illust_ranking (self , mode = ' day' , date = None , offset = None ):
126
+
119
127
# 趋势标签 (Search - tags) (无需登录)
120
128
def trending_tags_illust (self ):
121
129
@@ -127,6 +135,33 @@ class AppPixivAPI(BasePixivAPI):
127
135
# sort: [date_desc, date_asc]
128
136
# duration: [within_last_day, within_last_week, within_last_month]
129
137
def search_illust (self , word , search_target = ' partial_match_for_tags' , sort = ' date_desc' , duration = None ):
138
+
139
+ # 作品收藏详情 (无需登录)
140
+ def illust_bookmark_detail (self , illust_id ):
141
+
142
+ # 新增收藏
143
+ def illust_bookmark_add (self , illust_id , restrict = ' public' , tags = None ):
144
+
145
+ # 删除收藏
146
+ def illust_bookmark_delete (self , illust_id ):
147
+
148
+ # 用户收藏标签列表
149
+ def user_bookmark_tags_illust (self , restrict = ' public' , offset = None ):
150
+
151
+ # Following用户列表 (无需登录)
152
+ def user_following (self , user_id , restrict = ' public' , offset = None ):
153
+
154
+ # Followers用户列表 (无需登录)
155
+ def user_follower (self , user_id , filter = ' for_ios' , offset = None ):
156
+
157
+ # 好P友 (无需登录)
158
+ def user_mypixiv (self , user_id , offset = None ):
159
+
160
+ # 黑名单用户 (无需登录)
161
+ def user_list (self , user_id , filter = ' for_ios' , offset = None ):
162
+
163
+ # 获取ugoira信息
164
+ def ugoira_metadata (self , illust_id ):
130
165
~~~
131
166
132
167
[ Usage] ( https://github.com/upbit/pixivpy/blob/master/demo.py#L42 ) :
0 commit comments