Simple analysis of ACFUN login and fan list API

Share

Recently, I want to update the WordPress Fantasy directory plug-in I wrote before to produce an AcFun API version.
There is no fan tracking list on the website. I used Fiddler to grab the package of AcFun APP on the Android mobile terminal. Here I record the analysis results.

previously on

The API next door (BiliBili) has official documents, while the API on the AC side seems not to be public, and no public documents can be found. I can't help but pick up the bag by myself.

The API captured here is only for learning and should not be used for commercial purposes. The infringement caused by use is irrelevant to this article.

Sign in

  1. Request URL
     POST  https://id.app.acfun.cn/rest/app/login/signin
  2. Header (multiple statistics fields, mostly unnecessary)
     random: xxxx-xxxx-xxxx isp: CMCC mod: realme(RMX1931) acPlatform: ANDROID_PHONE User-agent: acvideo core/6.17.1.879(realme;RMX1931;5.1.1) mac: xx:xx:xx:xx:xxx uuid: 4ef877d8-e4d8-446e-97ef-d65a826e36cc deviceType: 1 net: WIFI Cookie: did=xxxxx-xxxx-xxxx-xxxx-xxxx; safety_id=xxxxx gid: xxxxxx androidId: xxxxx appVersion: 6.17.1.879 imei: xxxxx productId: 2000 market: tencent resolution: 720x1280 language: zh-cn udid: xxxxx-xxxx-xxxx-xxxx isChildPattern: false requestTime: 2020-03-xx 17:xx:xx.xxx sign: xxxxxxxx token:  Content-Type: application/x-www-form-urlencoded Content-Length: 39 Host: id.app.acfun.cn Connection: Keep-Alive Accept-Encoding: gzip
    • The required fields are deviceType Content-Type
  3. Request( application/x-www-form-urlencoded )
     username=18888888888&password=88888888
  4. Response( JSON )
     //Success { "mobile-check": 1, "group-level": 1, "acPassToken": "Cxxxxxxxxx", "mobile": "18888888888", "avatar": " https://imgs.aixifan.com/style/image/201907/xxxxxx.jpg ", "auth_key": 1888888, "userid": 1888888, "first_login": false, "token": "5c4xxxxxxxxxxxxxxxx", "check_real": 1, "result": 0, "acSecurity": "xxxxxxxxx/t96Q==", "check_password": 0, "passCheck": true, "username": "XXXX" } //Failed 1. The user password is incorrect { "result":100001005, "Error_msg": "The account does not exist or the password is incorrect" } //Failure 2, usually due to header parameter errors { "result": 302560072, "Error_msg": "[302560072] The server is busy, please try again later " }

Fan chasing list

  1. Request URL
     Get  https://api-new.acfunchina.com/rest/app/feed/favorite/bangumi
  2. Get parameter
    • count :int, Maximum number of returned results
    • pcursor : long, the index used for APP paging. The value is the last update time of the last script on the previous page (milliseconds).
      • To be more specific, the AC fan tracking list is sorted by the last update time to ensure that the first update is in the front row.
  3. Header (there are too many parameters, only necessary parameters are written)
     Cookies: (The following contents are one line, and all are string values of cookies)\ did=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx;  \ safety_id=xxxxxxxxxx;  \ auth_key=1888888; userId=1888888;  \ acPasstoken=xxxx; acfun.midground.api_st=xxxx; old_token=xxxx
    • Cookie Is required, and Cookie The required items inside are auth_key acPasstoen
    • auth_key The value of and userId The value of is the same. Is this the user ID used for verification.
    • You ask me how I know? Try it out.
  4. Response(JSON)
     { "result": 0, "feeds": [ { "groupId": "xxxxxxxxxx", "albumId": "5022158", "LastVideoName": "Twelfth Session", "lastUpdateTime": "2018-12-17", "coverUrls": [ " https://tx-free-imgs.acfun.cn/cms/2019_01_17/1547693211380.jpg?imageMogr2/format/webp/quality/75 !/ignore-error/1" ], "Caption": "Purple Girl", "ShowPlayCount": "7.04 million", "ShowStowCount": "71000", "showCommentCount": "7826", "ShowSerialStatus": "12 sessions", "verticalCoverUrls": [ " https://tx-free-imgs.acfun.cn/cms/2019_01_17/1547693206599.jpg?imageMogr2/format/webp/quality/75 !/ignore-error/1" ], "LastVideoDescription": "One day in 2018, girls met with" themselves "of another world. In a game, they imitated the urban legend and held a "certain ceremony". Unexpectedly, the ceremony opened the parallel world, and they stepped into a field different from their daily life, opening the door of the new world. ", "updateStatus": 0, "isOver": true, "updateDayOfWeek": 1, "isFavorite": true, "Description": "For information about AcFun dramas, please follow the microblog @ AcFun Xinfan.  nOne day in 2018, girls met with" themselves "in another world. \N The high school student Tugong Mingrijia and friends belong to the "Mineral Radio Research Association". In a game, they followed the urban legend to hold a "certain ceremony". Unexpectedly, the ceremony opened the parallel world, and they stepped into a field completely different from their daily life, thus opening the door to a new world. ", "stowCount": 71205, "shareUrl": " https://www.acfun.cn/bangumi/aa5022158 ", "likeCount": 297, "Intro": "For information about AcFun dramas, please follow the microblog @ AcFun Xinfan.  nOne day in 2018, girls met the" self "of another world. \N The high school student Tugong Mingrijia and friends belong to the "Mineral Radio Research Association". In a game, they followed the urban legend to hold a "certain ceremony". Unexpectedly, the ceremony opened the parallel world, and they stepped into a field completely different from their daily life, thus opening the door to a new world. ", "coverImageV": " https://tx-free-imgs.acfun.cn/cms/2019_01_17/1547693206599.jpg?imageMogr2/format/webp/quality/75 !/ignore-error/1", "coverImageH": " https://tx-free-imgs.acfun.cn/cms/2019_01_17/1547693211380.jpg?imageMogr2/format/webp/quality/75 !/ignore-error/1", "commentCount": 7826, "paymentType": { "value": 0, "Name": "Free" }, "playCount": 7004075, "area": 1, "acfunOnly": true, "Title": "Purple Girl", "PlayCountShow": "7.04 million", "firstPlayDate": 1538323200000, "updateWeekDay": 1, "updateDayTime": 39780000, "AreaShow": "Japan", "shareCount": 164, "isLike": false, "commentCountShow": "7826", "shareCountShow": "164", "StowCountShow": "71000", "id": 5022158, "lastVideoId": 6488676, "online": 1, "onlineTime": 1536567923000, "bangumiStyleList": [], "allowComment": true, "allowDownload": false, "updateDayTimeStr": "19:03", "LastUpdateItemName": "Twelfth Note", "commentParted": false, "LastUpdateItemTimeStr": "Updated in December 2018", "itemCount": 12 } ], "pcursor": "1545045917000", "host-name": "hb2-acfun-kcs027.aliyun", "requestId": "xxxxxxxxxxxxxxxxxxx" }

summary

Ailicili ~ (degree - degree)~-