Blog

一些关于 acfun 的 api

登录相关

登录相关的接口就两个,移动端和网页端

网页登录

Request

  • Method: POST
  • URL: https://id.app.acfun.cn/rest/web/login/signin
  • Headers:
    • Content-Type: application/x-www-form-urlencoded
  • Body:
1
2
3
4
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"key": null,
"captcha": null

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    {
    "result": 0,
    "img": "YOUR_AVATAR",
    "userId": 1,
    "username": "YOUR_USERNAME"
    }
    • failure
    1
    2
    3
    4
    {
    "result": 100001005,
    "error_msg": "帐号不存在或密码错误"
    }
    1
    2
    3
    4
    {
    "result":100001016,
    "error_msg":"图片验证码错误"
    }

注:只有短期内多次登录才需要输入验证码,所以 keycaptcha 只需留空,key 与 [获取登录验证码](# 获取登录验证码) 有关,captcha 即图片验证码在视觉上所展示的由 26 个英文字母及 10 个阿拉伯数字组成的 4 位字符串;userid 为用户 uid

客户端登录(旧)

Request

  • Method: POST
  • URL: http://account.app.acfun.cn/api/account/signin/normal
  • Headers:
    • Content-Type: application/x-www-form-urlencoded
  • Body:
1
2
3
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"cid": "ELSH6ruK0qva88DD"

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    {
    "name": "VDATA",
    "url": "",
    "errorid": 0,
    "errordesc": "",
    "vdata":
    {
    "token": "[ACCESS_TOKEN]",
    "expiration": 1556779288,
    "check_password": 0,
    "check_real": 0,
    "oauth": 0,
    "acPasstoken": "[ACPASSTOKEN]",
    "acSecurity": "[ACSECURITY]",
    "acPostHint": "[ACPOSTHINT]",
    "passCheck": true,
    "s2s-code": "[S2S-CODE]",
    "info":
    {
    "avatar": "http: \/\/cdn.aixifan.com\/dotnet\/artemis\/u\/cms\/www\/201806\/XXXX.jpg",
    "username": "[YOUR_USERNAME]",
    "userid": 1,
    "mobile": "",
    "group-level": 1,
    "mobile-check": 0
    }
    },
    "version": "1.0"
    }
    • failure
    1
    2
    3
    4
    5
    6
    7
    8
    {
    "name": "VDATA",
    "url": "",
    "errorid": 18165,
    "errordesc": " 帐号不存在或密码错误 ",
    "vdata": [],
    "version": "1.0"
    }

注:cid 的值固定不变,userid1 只为表明其类型为整型,expiration 是 token 失效时刻

客户端登录(新)

Request

  • Method: POST
  • URL: https://id.app.acfun.cn/rest/app/login/signin
  • Headers:
    • deviceType: 1
  • Body:
1
2
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    {
    "mobile-check": 0,
    "group-level": 1,
    "acPassToken": "[ACPASSTOKEN]",
    "mobile": null,
    "avatar": "https://imgs.aixifan.com/xxx",
    "auth_key": "[USERID]",
    "userid": "[USERID]",
    "first_login": false,
    "token": "[ACCESS_TOKEN]",
    "check_real": 0,
    "result": 0,
    "acSecurity": "ACSECURITY",
    "check_password": 0,
    "passCheck": true,
    "username": "[YOUR_USERNAME]"
    }
    • failure
    1
    2
    3
    4
    {
    "result": 100001005,
    "error_msg": "帐号不存在或密码错误"
    }

检查签到

网页端检查签到

Request

  • Method: GET
  • URL: http://www.acfun.cn/webapi/record/actions/signin?channel=0
  • Headers:
    • Cookie: [YOUR_COOKIE]

Response

  • Body
1
2
3
4
5
{
"code": 200,
"data":true,
"message": "OK"
}

客户端检查签到(旧)

Request

  • Method: POST

  • URL: http://api.new-app.acfun.cn/rest/app/user/hasSignedIn

  • Headers:

    • Content-Type: application/x-www-form-urlencoded

    • acPlatform: ANDROID_PHONE

    • appVersion: 6.1.1.740

    • Cookie:

      • auth_key: [YOUR_UID];
      • acPasstoken: [YOUR_ACPASSTOKEN];
  • Body:

1
"access_token": "YOUR_ACCESS_TOKEN"

Response

  • Body
1
2
3
4
5
6
{
"result": 0,
"hasSignedIn": true,
"host-name": "hb2-acfun-kcs075.aliyun",
"continuousDays": 0
}

客户端检查签到(新)

Request

  • Method: POST

  • URL: https://api-new.acfunchina.com/rest/app/user/hasSignedIn

  • Headers:

    • Cookie:

      • auth_key: [YOUR_UID];
      • acPasstoken: [YOUR_ACPASSTOKEN];
  • Body:

1
"access_token": "YOUR_ACCESS_TOKEN"

Response

  • Body
1
2
3
4
5
6
7
{
"result": 0,
"hasSignedIn": true,
"cumulativeDays": 284,
"host-name": "hb2-acfun-kcs169.aliyun",
"continuousDays": 1
}

注:cumulativeDays 为合计时长,continuousDays 为连签时长

签到

网页端 (旧)

Request

  • Method: POST
  • URL: http://www.acfun.cn/webapi/record/actions/signin?channel=0
  • Headers:
    • Cookie: [YOUR_COOKIE]

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
    "code": 200,
    "data":
    {
    "count": 3,
    "msg": "签到已成功,领取 3 蕉"
    },
    "message": "OK"
    }
    • failure
    1
    2
    3
    4
    {
    "code":410004,
    "message":"已签过到"
    }
    • GET
    1
    2
    3
    4
    5
    {
    "code": 200,
    "data":true,
    "message": "OK"
    }

网页端 (新)

Request

  • Method: POST

  • URL: https://www.acfun.cn/nd/pst?locationPath=signin&certified=[STRING]&channel=0&data=

  • Headers:

    • Cookie:

      • [YOUR_COOKIE];
      • stochastic: [STRING]

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
    "code": 200,
    "data":
    {
    "count": 3,
    "msg": "签到已成功,领取 3 蕉"
    },
    "message": "OK"
    }
    • failure
    1
    2
    3
    4
    {
    "code": 410004,
    "message": "已签过到"
    }
    1
    2
    3
    4
    {
    "code": -1,
    "msg": "用户校验失败"
    }

注:为 stochastic 所赋的值 STRING 可为空,只需保证 cookie 中 stochastic 与 URL 中 certified 值相等即可

客户端(旧)

Request

  • Method: POST

  • URL: http://api.new-app.acfun.cn/rest/app/user/signIn

  • Headers:

    • Content-Type: application/x-www-form-urlencoded

    • acPlatform: ANDROID_PHONE

    • appVersion: 6.1.1.740

    • Cookie:

      • auth_key: [YOUR_UID];
      • acPasstoken: [YOUR_ACPASSTOKEN];
  • Body:

1
"access_token": "YOUR_ACCESS_TOKEN"

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    {
    "result": 0,
    "msg": "签到成功,领取 6 蕉",
    "bananaDelta": 6,
    "host-name": "hb2-acfun-kcs026.aliyun",
    "continuousDays": 1
    }
    • failure
    1
    2
    3
    4
    5
    6
    {
    "result": 122,
    "msg": "今日已签到",
    "error_msg": "今日已签到",
    "host-name": "hb2-acfun-kcs045.aliyun"
    }

客户端(新)

Request

  • Method: POST

  • URL: https://api-new.acfunchina.com/rest/app/user/signIn

  • Headers:

    • acPlatform: ANDROID_PHONE

    • Cookie:

      • auth_key: [YOUR_UID];
      • acPasstoken: [YOUR_ACPASSTOKEN];
  • Body:

1
"access_token": "YOUR_ACCESS_TOKEN"

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    {
    "result": 0,
    "msg": "签到成功,领取 6 蕉",
    "bananaDelta": 6,
    "host-name": "hb2-acfun-kcs023.aliyun",
    "almanac":
    {
    "todayRecoGuideMsg": "你们城里人真会看片",
    "todayRecoResourceId": "5024920",
    "todayRecoResourceType": 1,
    "guideMsg": "分享一下还有惊喜哦~",
    "fortune": "小吉",
    "suits":
    [
    "打桌游",
    "在胡同里狂奔",
    "结识新朋友"
    ],
    "avoids":
    [
    "符咒贴在脑门",
    "消消乐",
    "九点去买海鲜"
    ]
    },
    "continuousDays": 1
    }
    • failure
    1
    2
    3
    4
    5
    6
    {
    "result": 122,
    "msg": "今日已签到",
    "error_msg": "今日已签到",
    "host-name": "hb2-acfun-kcs045.aliyun"
    }

投蕉

网页端

Request

  • Method: POST
  • URL: https://www.acfun.cn/banana/throwBanana.aspx
  • Headers:
    • Cookie: [YOUR_COOKIE]
  • Body:
1
2
3
"contentId": "[ACID]"
"count": "[THROW_BANANA_COUNT]"
"userId": "[USERID]"

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    {
    "success": true,
    "result": "操作成功",
    "info": "操作成功",
    "status": 200
    }
    • failure
    1
    2
    3
    4
    5
    6
    {
    "success": false,
    "result": "该稿件已扔过香蕉",
    "info": "该稿件已扔过香蕉",
    "status": 400
    }
    1
    2
    3
    4
    5
    6
    {
    "success": false,
    "result": "赠予香蕉数量错误",
    "info": "赠予香蕉数量错误",
    "status": 400
    }

注:contentId 为被投稿的 ac 编号;count 为投蕉数量,取值应在区间 [1,5],userId 为用户 UID

检查在线状态

网页端

Request

  • Method: GET
  • URL: http://www.acfun.cn/online.aspx
  • Headers:
    • Cookie: [YOUR_COOKIE]

Response

  • Body

    • success
    1
    2
    3
    4
    5
    6
    7
    {
    "success": true,
    "isdisabled": false,
    "level": "[YOUR_LEVEL]",
    "status": 200,
    "duration": "[YOUR_DURATION]"
    }
    • failure
    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
    "success": false,
    "isdisabled": false,
    "level": 0,
    "status": 401,
    "duration": 0,
    "result": "请先登陆",
    "info": "请先登陆"
    }

获取登录验证码

网页端 / 客户端

Request

  • Method: GET
  • URL:
    • https://id.app.acfun.cn/rest/web/login/captcha
    • https://id.app.acfun.cn/rest/app/login/captcha

Response

  • Body

    • success
    1
    2
    3
    4
    5
    {
    "result":0,
    "image":"data:image/png;base64,...",
    "key":"[KEY]"
    }

    注:key 值与 [网页登录](# 网页登录) 关联,客户端与网页返回的结果结构一致

    • failure
      (待补全 )

 评论

 无法加载Disqus评论系统,请确保您的网络能够正常访问。

Copyright © 2018 - 2020 バンカ の メモ帳

本站使用 Material X 作为主题 。