upbit / pixivpy

Pixiv API for Python
https://pypi.org/project/PixivPy3/#files
The Unlicense
1.78k stars 148 forks source link

All public APIs are not accessible #45

Closed equt closed 6 years ago

equt commented 7 years ago

抓了一下,现在是

GET /v1/application-info/ios HTTP/1.1
Host: app-api.pixiv.net
Authorization: Bearer pSGRpYrarjmWceB-Pg5jHr1i4WEbDSBKGJeMJXvv_o4
App-Version: 6.9.0
X-Client-Time: 2017-09-08T11:19:15+08:00
App-OS: ios
X-Client-Hash: ec3bca47bf52223b5ad0bba942550dd3
Accept-Encoding: gzip, deflate
Accept-Language: zh-cn
Accept: */*
User-Agent: PixivIOSApp/6.9.0 (iOS 11.0; iPhone7,2)
Connection: keep-alive
App-OS-Version: 11.0

又需要一波大改啊

upbit commented 7 years ago

没太看明白,是说Public-API已经修改了吗? 看这请求,是App-API的客户端信息接口,App-API也有调整?

equt commented 7 years ago

我刚刚仔细再看了一下:

  1. Pixiv 在 OAuth 里新增了一个 device_token 报头;
  2. 现在所有 App 里的请求应该都需要 Authorization 了,不能免登录操作了,除非解决 Bearer 的生成问题(手头现在没有安卓,不清楚所有安卓机是不是依旧使用同一个 Bearer
upbit commented 7 years ago

哦,那确实有可能。Bearer Token如果是所有请求都检查,那应该是全部接口都要求auth了 有急需修复的API可以随时反馈我,这个我也抽时间整体验证下。

equt commented 7 years ago

稍微改了改到能用的程度 #46

equt commented 7 years ago

device_token 测试下来,只有卸载重装应用才会改变,应该是与 VendorID 有关,参见 Uniquely identify an iOS device. | Apple Developer Forums,和 identifierForVendor - UIDevice | Apple Developer Documentation

jhnadlh commented 6 years ago

Does this mean that the api is no longer functioning?

Xdynix commented 6 years ago

@jhnadlh According to my recent usage, all the APIs are still available, except the App APIs need to add the parameter req_auth=True.

jhnadlh commented 6 years ago

@Xdynix When I tried changing e.g illust_detail(*) to req_auth=True, and running the example in the README (with login) :

Nevermind - it was a problem with repeated login-attempts. Thanks.

kaecy commented 6 years ago

Yes you can't use it without logging in anymore. I tried and failed.

By the way how do you get the illusts from like from this page "https://www.pixiv.net/ranking.php?mode=daily&content=illust". I've been using "https://app-api.pixiv.net/v1/illust/ranking" but they put manga in between entries. Uhm, what I mean is they replace some entry with manga.