获取不通过视频列表

点击这里查看旧版

接口URL

http://api.polyv.net/v2/video/{userid}/get-illegal-list

接口说明

获取用户不能通过审核的视频列表

支持格式

XML/JSON

请求方式

POST,GET

请求数限制

TRUE

请求参数

参数名 必选 类型及范围 说明
ptime true string 当前13位毫秒级时间戳,3分钟内有效
userid true string 用户id
pageNum true int 取第几页
numPerPage true int 平均每页多少条数据
sign true string 非业务参数,签名,40位大写SHA1值
format false string 默认返回json格式,如果format=xml返回xml格式
jsonp false string 例如,正常情况{error:0,data:””},加 jsonp=a后返回a({error:0,data:””})

返回结果xml示例

<xml>
  <code>200</code>
  <status>success</status>
  <message></message>
  <total>1</total>
  <data>
    <videodetail>
    <tag></tag>
    <mp4>http://mpv.videocc.net/3828390191/0/382839019120b4ec44ca42b354b660d0_1.mp4</mp4>
    <df>1</df>
    <times>0</times>
    <vid>382839019120b4ec44ca42b354b660d0_3</vid>
    <mp4_1>http://mpv.videocc.net/3828390191/0/382839019120b4ec44ca42b354b660d0_1.mp4</mp4_1>
    <cataid>1</cataid>
    <swf_link>http://player.polyv.net/videos/382839019120b4ec44ca42b354b660d0_3.swf</swf_link>
    <status>51</status>
    <seed>0</seed>
    <playerwidth>600</playerwidth>
    <duration>00:04:05</duration>
    <first_image>http://img.videocc.net/uimage/3/3828390191/0/382839019120b4ec44ca42b354b660d0_0.jpg</first_image>
    <original_definition>512x288</original_definition>
    <context></context>
    <playerheight>337</playerheight>
    <ptime>2017-04-26 10:48:50</ptime>
    <source_filesize>8747234</source_filesize>
    <filesize>9294215</filesize>
    <md5checksum>dd504186e1d3ab072ac844e9174355f9</md5checksum>
    <hls>http://hls.videocc.net/3828390191/3/382839019120b4ec44ca42b354b660d0_1.m3u8</hls>
    </videodetail>
  </data>
</xml>

JSON示例

{
  code: 200,
  status: "success",
  message: "success",
  data: [
  {
    tag: "",
    mp4: "http://mpv.videocc.net/3828390191/0/382839019120b4ec44ca42b354b660d0_1.mp4",
    title: "1221",
    df: 1,
    times: "0",
    vid: "382839019120b4ec44ca42b354b660d0_3",
    mp4_1: "http://mpv.videocc.net/3828390191/0/382839019120b4ec44ca42b354b660d0_1.mp4",
    cataid: "1",
    swf_link: "http://player.polyv.net/videos/382839019120b4ec44ca42b354b660d0_3.swf",
    status: "51",
    seed: 0,
    playerwidth: "600",
    duration: "00:04:05",
    first_image: "http://img.videocc.net/uimage/3/3828390191/0/382839019120b4ec44ca42b354b660d0_0.jpg",
    original_definition: "512x288",
    context: "",
    playerheight: "337",
    ptime: "2017-04-26 10:48:50",
    source_filesize: 8747234,
    filesize: [
      9294215
    ],
    md5checksum: "dd504186e1d3ab072ac844e9174355f9",
    hls: [
        "http://hls.videocc.net/3828390191/3/382839019120b4ec44ca42b354b660d0_1.m3u8"
    ]
  }
  ],
  total: 1
}

返回错误json

{
  "code":400,
  "status":"error",
  "message":"ptime is too old.",
  "data":""
}

字段说明

字段 说明
error 错误提示
swf_link 返回flash连接
duration 返回时长
title 标题
first_image 视频图片
times 点击次数
tag 标签
context 内容
ptime 上传时间
vid 视频id

PHP示例代码

<?php
  header("Content-type: text/html; charset=utf-8");
  $userid="3828390191";
  $format="json";
  $jsonp="";//(注意如果这里如果没有jsonp,则不需要拼接&jsonp=参数)
  $numPerPage=100;
  $pageNum=1;
  $ptime=time()*1000;//13位
  $secretkey="tIQp4ATe9Z";
  if (empty($jsonp)) {
      $str="format=".$format."&numPerPage=".$numPerPage."&pageNum=".$pageNum."&ptime=".$ptime.$secretkey;
  }else{
      $str="format=".$format."&jsonp=".$jsonp."&numPerPage=".$numPerPage."&pageNum=".$pageNum."&ptime=".$ptime.$secretkey;
  }
  //echo $str.'<br>';
  $hash=strtoupper(sha1($str));
  //echo $hash.'<br>';
  $url="http://api.polyv.net/v2/video/{$userid}/get-illegal-list";
  $post_data = array (
      "format" => $format,
      "jsonp" => $jsonp,
      "numPerPage" => $numPerPage,
      "pageNum" => $pageNum,
      "ptime" => $ptime,
      "sign" => $hash
  );
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  // post数据
  curl_setopt($ch, CURLOPT_POST, 1);
  // post的变量
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
  $output = curl_exec($ch);
  curl_close($ch);
  //打印获得的数据
  print_r($output);
?>

签名规则:

将非空的请求参数按照参数名字典顺序排列,连接参数名与参数值,并在尾部加上secretkey,生成40位大写SHA1值,作为sign。 以下是示例过程:

1、请求参数为

"ptime" = "1493177403000"
"format" = "json"
"numPerPage" = "100"
"pageNum" = "1"

2、将请求参数按照参数名字典顺序排列

"format" = "json"
"numPerPage" = "100"
"pageNum" = "1"
"ptime" = "1493177403000"

3、连接字符串
连接参数名与参数值,并在尾部加上secretkey(secretkey的值为tIQp4ATe9Z),如下:

format=json&numPerPage=100&pageNum=1&ptime=1493177403000tIQp4ATe9Z

4、生成签名sign

73AB924C6C821255D4DF58ED77139D79E97DF1BB
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...