Giter VIP home page Giter VIP logo

youku_speed_up's Introduction

优酷宽带加速API(2017.7.1)

1.登录

1.1 获取表单Token

http://account.youku.com/refreshFormToken.json (或 http://account.youku.com/getConfig.json

返回值

null({
    "data": {
        "formtoken": "B99D8D94C231583B742A7AF59BF8151B"
    },
    "errorCode": "",
    "errorMsg": "",
    "result": "success"
})

1.2 登录

http://account.youku.com/login/confirm.json

请求参数

{
	"formtoken": formtoken,
	"passport": passport,
	"password": md5(password),
	"loginType": "passport_pwd",
	"UA": "FFFF00000000016514CE",
	"jsToken": "0"
}

返回值

null({
    "errorCode": "",
    "errorMsg": "",
    "msg": {
        "domains": [
            "account.laifeng.com",
            "account.tudou.com",
            "account.soku.com",
            "account.youku.com"
        ]
    },
    "result": "success"
})

2.获取状态

http://vip.youku.com/ajax/speedup/get_status.jsonp

返回值

callback({
    "code": "20000",
    "msg": "成功",
    "result": {
        "speed_up_state": false,
        "speed_up_switch": 1 # 1:开启, 2:关闭
    }
})

3.开启「加速服务开关」

http://vip.youku.com/?c=ajax&a=ajax_speedup_service_switch

返回值

{
    "code": "20000",
    "msg": "成功",
    "result": {
        "state": "2"
    }
}

4.开启「宽带加速」

http://vip.youku.com/?c=ajax&a=ajax_do_speed_up

返回值

// 成功

// 失败
{
    "code": "20023",
    "msg": "运营商繁忙",
    "type": "operator_not_range",
    "result": {
        "operator_error_code": 2001,
        "operator_error_msg": "**电信提示:[2001]业务处理错误:用户线路暂不具备提速能力,加速ID:xxxxxxxxx"
    }
}

不要问我「加速服务开关」与「宽带加速」的区别,我可讲不清。。。

youku_speed_up's People

Contributors

0x5e avatar asundust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

youku_speed_up's Issues

这个现在能用吗

试了下,返回说未登录

<script> (function(){ var hostname = window.location.hostname.toLowerCase(), arr = hostname.split('.'), len = arr.length;document.domain = arr[len-2] + '.' + arr[len-1];var parent = window.parent, callback = parent['logincallback_1467279091960'], rs = {"errno":-96,"desc":"","data":{}}; if(parent && callback){ callback(rs);} })();</script>
{
  "code": "20011",
  "msg": "用户未登录",
  "type": "login"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.