无效的刷新令牌

时间:2018-09-06 17:07:54

标签: php api

开发人员。

我无法将视频上传到Dailymotion。第一次上传有效,当我尝试发送第二个视频时,出现错误消息,依此类推,一个视频被发送,另一个视频失败。错误消息是:

“无效的刷新令牌”

我的代码

$url = $request->file("file");
$api = new Dailymotion();
$api->setGrantType(
Dailymotion::GRANT_TYPE_PASSWORD,
"xxxxxxxxx",
"xxxxxxxx",
array("manage_videos","userinfo","manage_playlists","manage_user_settings","manage_applications"),
array(
"username" => "xxx@xxx.com.br",
"password" => "xxx",
));
$api->logout();
$videoUrl = $api->uploadFile($url);

$result = $api->post(
"/me/videos",
array("url" => $videoUrl, "title" =>"teste de vídeo"
));

1 个答案:

答案 0 :(得分:0)

像这样更改代码:

$url = $request->file("file");
$api = new Dailymotion();
$api->setGrantType(Dailymotion::GRANT_TYPE_PASSWORD,"xxxxxxxxx","xxxxxxxx",array("manage_videos","userinfo","manage_playlists","manage_user_settings","manage_applications"),
array("username" => "xxx@xxx.com.br","password" => "xxx",));
$videoUrl = $api->uploadFile($url);

$result = $api->post(
"/me/videos",
array("url" => $videoUrl, "title" =>"teste de vídeo"
));

$api->logout();