Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php DailyMotion云API如何获得具有严格安全性的URL?_Php_Security_Iframe_Streaming_Dailymotion Api - Fatal编程技术网

Php DailyMotion云API如何获得具有严格安全性的URL?

Php DailyMotion云API如何获得具有严格安全性的URL?,php,security,iframe,streaming,dailymotion-api,Php,Security,Iframe,Streaming,Dailymotion Api,我被DailyMotionCloudAPI困住了 我需要签署一个安全级别的网址 仅限法国 仅允许引用:1域oxygenstream.fr 我的代码可以工作,但我不知道在签名我的URL时将安全级别放在哪里 我应该把它放在组件[-]这里: 我应该如何在[-]中存储de referer严格的URL和国家/地区 以下是CloudKey.php的代码: 这是我的密码: 提前谢谢你帮我解决这个问题。希望你知道如何修复我的代码 祝你今天过得愉快 Antoine由于您使用的是CloudKey PHP SDK,因

我被DailyMotionCloudAPI困住了 我需要签署一个安全级别的网址

仅限法国 仅允许引用:1域oxygenstream.fr 我的代码可以工作,但我不知道在签名我的URL时将安全级别放在哪里 我应该把它放在组件[-]这里:

我应该如何在[-]中存储de referer严格的URL和国家/地区

以下是CloudKey.php的代码:

这是我的密码:

提前谢谢你帮我解决这个问题。希望你知道如何修复我的代码

祝你今天过得愉快


Antoine

由于您使用的是CloudKey PHP SDK,因此您不必亲自构建URL

在使用SDK时,这对我很有用:

$user_id = 'aaaaaaaaaaaaaaaaaaaaaa'; 
$api_key = 'bbbbbbbbbbbbbbbbbbbbbb'; 
$media_id = '5466232b947399290102cdb6';
$preset_id = '54662c7c06361d307810e3b5';
$preset_name = 'OxygenStream';

$seclevel = CLOUDKEY_SECLEVEL_COUNTRY | CLOUDKEY_SECLEVEL_REFERER_STRICT ;
$countries = array('fr');
$referers = array('http://oxygenstream.fr/vod/dmcloud');

$cloudkey = new CloudKey($user_id, $api_key);
$url = $cloudkey->media->get_embed_url(array('id' => $media_id, 'seclevel' => $seclevel, 'expires' => time() + 3600, 'countries' => $countries, 'referers' => $referers));

致命错误:未捕获异常“InvalidArgumentException”,消息“国家/地区格式无效,应该是一组国家代码。“in/home/www/0b2aa259c9df807691830fefd389c3e7/web/vod/dmcloud/CloudKey.php:464堆栈跟踪:0/home/www/0b2aa259c9df807691830fefd389c3e7/web/vod/dmcloud/index.php76:CloudKey\u Helpers::sign\u url”https://api.dmc...','1fc52a95421f0c1…',32800,NULL,NULL,NULL,'cc=fr','rf=http://www.o...“,NULL 1{main}在第464行的/home/www/0b2aa259c9df807691830fefd389c3e7/web/vod/dmcloud/CloudKey.php中抛出,这是由于您没有传递国家代码数组而导致的。国家代码数组应该看起来像数组'fr','be'等。。。如果有帮助,请查看我的完整答案。如果我不希望此URL过期,我只需要删除“expires”=>time+3600,对吗?
$user_id = 'aaaaaaaaaaaaaaaaaaaaaa'; 
$api_key = 'bbbbbbbbbbbbbbbbbbbbbb'; 
$media_id = '5466232b947399290102cdb6';
$preset_id = '54662c7c06361d307810e3b5';
$preset_name = 'OxygenStream';

$seclevel = CLOUDKEY_SECLEVEL_COUNTRY | CLOUDKEY_SECLEVEL_REFERER_STRICT ;
$countries = array('fr');
$referers = array('http://oxygenstream.fr/vod/dmcloud');

$cloudkey = new CloudKey($user_id, $api_key);
$url = $cloudkey->media->get_embed_url(array('id' => $media_id, 'seclevel' => $seclevel, 'expires' => time() + 3600, 'countries' => $countries, 'referers' => $referers));