du13932014807 2015-03-18 19:00
浏览 21
已采纳

在Dailymotion API上检索未发布的视频

I'm trying to retrieve the unpublished videos I have on my DM account, i.e. the videos I've uploaded to DM but are not yet public. I'm using the PHP SDK v1.6.3 and I'm quite a beginner with the Dailymotion API.

I assume (but I'm not 100% sure) that I have to use the private filter as documented here

I've tried

$api->get('/me/videos',array('filters' => array('private')));

which raises a DailymotionApiException exception with the following message

Unrecognized value (private), allowed values are (featured, hd, official, creative, creative-official, ugc, buzz, buzz-premium, 3d, live, live-offair, game, all-live, live-upcoming, no-live, premium, premium-paidvideos, premium-offers, no-premium, history, with-poster, without-poster, promoted-on-games) at index #0 for `filters' parameter

which is strange because from this doc, 'private' is a valid filter for videos.

I've also tried

$api->get('/me/videos',array('filters' => array('private' => true)));

which apparently has a wrong format as it also raises a DailymotionApiException exception

Invalid type (array required, dict given) for `filters' parameter

Is there something wrong with the way I use filters in the PHP SDK ?

  • 写回答

1条回答 默认 最新

  • duanguochi6194 2015-03-19 10:48
    关注

    There are 2 mistakes in what you do:

    • first, "private" is different from "unpublished"
    • they way you call the filters is not the right one.

    1) A private video is only viewable by you on dailymotion as it does not appear on your channel page. You can share it with other users by sharing the private permalink that you can retrieve using the url field.

    An unpublished video is only viewable by you and can't be shared. It should be used when you edit the video (description, title, etc) before publishing it.

    2) Now, about the way you call the PHP SDK: private is a filter by itself, you don't need to add the filters parameter. The filters filter is deprecated (see https://developer.dailymotion.com/documentation#video-filters-filter).

    Your call has to be using either of: flags=private or: private filter. With the PHP SDK, you could use:

    $result = $api->get('/me/videos',array('flags' => array('private')));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?