Skip to content

Proxy with PixivLite

Zhou Hao edited this page Apr 27, 2019 · 8 revisions

发现PixivLite可以直接免翻Q,实现pixiv的浏览。自从P站被墙后,API都处于半停止状态(主要是(lan)...挂代理后无法抓包),有这种代理的话调起来也简单些。

PixivLite实现主要依赖于以下几点:

  1. 通过 http://api.pixivlite.com/index.php/index/index/config 查询各P站服务的DNS(然而并没有看出来哪里用了)
  2. 通过app.pixivlite.com/index.php进行鉴权代理(非常不安全,帐号密码都是明文发送的,见下查询用户名密码)
  3. 通过app-api.pixivlite.com代理各种AppAPI

下面是一些请求的例子:


无需登录接口

  1. 查询DNS: http://api.pixivlite.com/index.php/index/index/config
  2. 浏览作品: http://app-api.pixivlite.com/v1/walkthrough/illusts
  3. 查询用户名密码: http://api.pixivlite.com/index.php/user/index/getDeviceToken?account=username

最后这个接口很无语,登录一次后你的账号名密码,可以明文的从这个接口获取到(当然,里面的内容是我乱写的):

{
  id: 87821,
  account: "username",
  email: "[email protected]",
  device_token: "ab128762c456a87c0e9efa268c71bfad3",
  create_time: 1556355925,
  update_time: null,
  password: "password",
  is_quick: 0
}

登录验证

POST http://api.pixivlite.com/index.php/user/index/login HTTP/1.1
Host: api.pixivlite.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
Connection: keep-alive
Accept: */*
User-Agent: pixiv-client/3.0.16 (com.bravedefault.ehreader; build:97; iOS 12.2.0) Alamofire/4.8.1
Accept-Language: zh-Hans-CN;q=1.0
Content-Length: 233
Accept-Encoding: gzip;q=1.0, compress;q=0.5

agent=PixivIOSApp/7.4.7%20%28iOS%2012.2%3B%20iPhone7%2C1%29&device_token=ab128762c456a87c0e9efa268c71bfad3&password=password&username=username&x-client-hash=81aa57bf6a1de2895224dd657e084592&x-client-time=2019-04-27T16%3A25%3A24%2B08%3A00

上传用户名密码

POST http://api.pixivlite.com/index.php/user/index/updateUserDeviceToken HTTP/1.1
Host: api.pixivlite.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Connection: keep-alive
Connection: keep-alive
Accept: */*
User-Agent: pixiv-client/3.0.16 (com.bravedefault.ehreader; build:97; iOS 12.2.0) Alamofire/4.8.1
Accept-Language: zh-Hans-CN;q=1.0
Content-Length: 110
Accept-Encoding: gzip;q=1.0, compress;q=0.5

account=username&device_token=ab128762c456a87c0e9efa268c71bfad3&[email protected]&is_quick=0&password=password

榜单接口

GET http://app-api.pixivlite.com/v1/illust/ranking?filter=for_ios&mode=day HTTP/1.1
Host: app-api.pixivlite.com
app-version: 7.4.7
Authorization: Bearer <Bearer Token>
Connection: keep-alive
x-client-time: 2019-04-27T16:25:24+08:00
app-os: ios
x-client-hash: 81aa57bf6a1de2895224dd657e084592
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: zh-cn
User-Agent: PixivIOSApp/7.4.7 (iOS 12.2; iPhone7,1)
Connection: keep-alive
app-os-version: 12.2

从接口看基本就是代理,应该大部分AppAPI都是可以直接用的(待验证)

CDN请求

GET https://i.pximg.net/c/540x540_70/img-master/img/2018/07/22/00/00/19/69797030_p0_master1200.jpg HTTP/1.1
Host: i.pximg.net
Connection: keep-alive
Accept: */*
User-Agent: PixivAndroidApp/5.0.118 (Android 6.0; NEM-TL00H)
Referer: https://app-api.pixiv.net/
Accept-Language: zh-cn
Accept-Encoding: br, gzip, deflate

HTTP/1.1 200 OK
Server: nginx
Date: Sat, 27 Apr 2019 08:26:36 GMT
Content-Type: image/jpeg
Content-Length: 48676
Connection: keep-alive
Cache-Control: max-age=31536000
Expires: Sat, 11 Apr 2020 12:16:47 GMT
Last-Modified: Sat, 21 Jul 2018 15:00:19 GMT
Via: http/1.1 f011 (second), http/1.1 f011 (second)
X-Content-Type-Options: nosniff
Age: 616064
Accept-Ranges: bytes

...