获取视频流媒体信息

1. 接口描述

URL https://openapi.youku.com/router/rest.json
功能描述 通过视频ID获取视频流信息,包括音视频格式、分辨率、文件大小等
返回格式 json,UTF8
HTTP请求方式 GET
是否需要登录
当前接口版本 V3

2. 系统参数

参数名 参数全称 必选 参数类型 参数描述
action action true String youku.api.vod.get.videostream
client_id client_id true String 应用的client id
access_token access token false String oauth2的token
timestamp timestamp true String 客户端当前时间戳,精确到秒,timestamp与开放平台请求时间误差为6分钟
version version true String API协议版本,默认值3.0
sign_method sign_method false String 签名的摘要算法,可选值为:HmacSHA256,md5。默认为md5
sign sign true String 对API调用参数(除sign外)的md5加密值。详情见签名方法

3. 业务参数

参数名 参数全称 必选 参数类型 参数描述
_id _id true String 视频信息ID,注:此处做签名时需要排在最前面
secret_id secret_id false String secret_id
player_id player_id false long 播放器ID
is_play_action is_play_action false boolean 获取接口信息是否用于视频播放,默认为是
ip ip false string 客户端ip
plat_form plat_form false string 播放来源:pc,app

4. 返回参数

参数名 参数全称 必选 参数类型 参数描述
error error true object 错误码
_id _id true string 视频ID
title title true string 视频时间
tags tags true string 视频标签
desc desc true string 视频描述
ct ct true long 记录创建时间
attr_values attr_values true jsonarray 视频属性
category_id category_id true int 视频分类
uid uid true string 用户id
status status true int 文件状态
poster_url poster_url true string 截图地址

5. 调用示例

https://openapi.youku.com/router/rest.json?ip=220.181.34.100&op_check=0
&_id=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c
&plat_form=pc&is_play_action=false&opensysparams={"format": "json",
"action":"youku.api.vod.get.videostream","version": "3.0","client_id":"163d4fd10c7f9a28","timestamp": 1466999847,"sign":"061c01fd9fe3abb7bf5f768cb6493641"}
  			

6. 响应示例

{
    'cost': 0.07500000298023224,
    'e': {
        'provider': 'cloudvideo',
        'desc': '',
        'code': 0
    },
    'data': {
        'mp4': [
            {
                'codetype': {
                    'type': '0',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '250k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'mp4'
                },
                'duration': 36.733333587646484,
                'quality': '0',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AA10001000024B757615922-0CF2-19A8-3A5A-C40D00000000.mp4',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AA10001000024B757615922-0CF2-19A8-3A5A-C40D00000000.mp4&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 828740
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            },
            {
                'codetype': {
                    'type': '1',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '500k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'mp4'
                },
                'duration': 36.733333587646484,
                'quality': '1',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AAB0001000024B757615922-0CF2-19A8-3A5A-C40E00000000.mp4',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AAB0001000024B757615922-0CF2-19A8-3A5A-C40E00000000.mp4&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 828740
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            },
            {
                'codetype': {
                    'type': '2',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '1000k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'mp4'
                },
                'duration': 36.733333587646484,
                'quality': '2',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AA10001000024B757615922-0CF2-19A8-3A5A-C40F00000000.mp4',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AA10001000024B757615922-0CF2-19A8-3A5A-C40F00000000.mp4&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 828740
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            }
        ],
        'ts': [
            {
                'm3u8': 'http: //101.201.172.30: 80/cloudvideo/m3u8_route/m3u8TokenRoute.json?sign=1468296562506i2Gu&sid=5363782',
                'duration': 36.733333587646484,
                'quality': '3',
                'source': 0,
                'codetype': {
                    'type': '3',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '2000k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'ts'
                },
                'slices': '',
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 5
            },
            {
                'm3u8': 'http: //101.201.172.30: 80/cloudvideo/m3u8_route/m3u8TokenRoute.json?sign=1468296562506i2Gu&sid=5363797',
                'duration': 36.733333587646484,
                'quality': '0',
                'source': 0,
                'codetype': {
                    'type': '0',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '250k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'ts'
                },
                'slices': '',
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 5
            },
            {
                'm3u8': 'http: //101.201.172.30: 80/cloudvideo/m3u8_route/m3u8TokenRoute.json?sign=1468296562506i2Gu&sid=5363802',
                'duration': 36.733333587646484,
                'quality': '1',
                'source': 0,
                'codetype': {
                    'type': '1',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '500k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'ts'
                },
                'slices': '',
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 5
            },
            {
                'm3u8': 'http: //101.201.172.30: 80/cloudvideo/m3u8_route/m3u8TokenRoute.json?sign=1468296562506i2Gu&sid=5363810',
                'duration': 36.733333587646484,
                'quality': '4',
                'source': 0,
                'codetype': {
                    'type': '4',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '0k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '0k',
                    'muxer': 'ts'
                },
                'slices': '',
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 5
            },
            {
                'm3u8': 'http: //101.201.172.30: 80/cloudvideo/m3u8_route/m3u8TokenRoute.json?sign=1468296562506i2Gu&sid=5363805',
                'duration': 36.733333587646484,
                'quality': '2',
                'source': 0,
                'codetype': {
                    'type': '2',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '1000k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'ts'
                },
                'slices': '',
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 5
            }
        ],
        'flv': [
            {
                'codetype': {
                    'type': '0',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '250k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'flv'
                },
                'duration': 36.733333587646484,
                'quality': '0',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AA20001000024B757615922-0CF2-19A8-3A5A-C41100000000.flv',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AA20001000024B757615922-0CF2-19A8-3A5A-C41100000000.flv&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 846206
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            },
            {
                'codetype': {
                    'type': '1',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '500k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'flv'
                },
                'duration': 36.733333587646484,
                'quality': '1',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AA20001000024B757615922-0CF2-19A8-3A5A-C41200000000.flv',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AA20001000024B757615922-0CF2-19A8-3A5A-C41200000000.flv&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 846206
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            },
            {
                'codetype': {
                    'type': '2',
                    'vcodec_type': 'libx264',
                    'vcodec_args': '1000k',
                    'acodec_type': 'libfdk_aac',
                    'resolution': '320x180',
                    'ratio': '320: 180',
                    'acodec_args': '128k',
                    'muxer': 'flv'
                },
                'duration': 36.733333587646484,
                'quality': '2',
                'source': 0,
                'slices': [
                    {
                        'source_info': '',
                        'duration': 36.733333587646484,
                        'status': 2,
                        'start_time': 0,
                        'file_name': '400204000057615AA30001000024B757615922-0CF2-19A8-3A5A-C41300000000.flv',
                        'play_url': 'http: //kvod.open.youku.com/cloudvideo/kservice-route/get.json?timestamp=1468296562&fid=400204000057615AA30001000024B757615922-0CF2-19A8-3A5A-C41300000000.flv&ns=uvod.cloud.youku.com&vid=569c9e7f0cf2ebcd9893f552&customer_id=55b1e538e4b075d6cceec82c&sign=1468296562506i2Gu',
                        'seq_no': 1,
                        'file_size': 846206
                    }
                ],
                'post_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?fid=05A000009569C9E89000000000EB3C659.png&ns=uvod-thumb.cloud.youku.com&customer_id=55b1e538e4b075d6cceec82c',
                'slice_num': 1
            }
        ],
        'player_info': {
            'logo_url': 'http: //101.201.172.30/cloudvideo/kservice-route/get.json?ns=cmt-permv.cloud.youku.com&fid=05a30060569c5f273e56ab10349938dd.png',
            'style': '#008299',
            'uid': '55b1e538e4b075d6cceec82c',
            'status': 1,
            'id': 9,
            'create_time': 1452924843,
            'update_time': 1453105214,
            'position': 3,
            'target_url': 'www.baidu.com',
            'name': 'player002'
        }
    }
}

7. 异常示例

8. 注意事项