gpt4 book ai didi

php - YouTube API PHP V3:使用RecordingDetails上传(Google API Client V2)

转载 作者:行者123 更新时间:2023-12-03 05:29:07 27 4
gpt4 key购买 nike

只要包含“RecordingDetails”,每个YouTube上载 call 都会失败。

下面是简单的Call(提取):

$rc=new \Google_Service_YouTube_VideoRecordingDetails();
$rc->setRecordingDate('2016-08-02T21:17:00.000Z');
$video->setRecordingDetails($rc);

失败。
我也尝试过使用位置:
$rc=new \Google_Service_YouTube_VideoRecordingDetails();
$ld=new \Google_Service_YouTube_GeoPoint();
$ld->setLatitude(36.527294814546);
$ld->setLongitude(128.5400390625);
$rc->setLocation($ld);
$video->setRecordingDetails($rc);

发生相同的错误。
此外,错误消息并不是真正有用的:)
"error": {
"errors": [
{
"domain": "youtube.part",
"reason": "unexpectedPart",
"message": "{0}",
"locationType": "parameter",
"location": "part"
}
],
"code": 400,
"message": "{0}"
}
}

有没有人提到使用Api V3和Google Client V2和RecordingDetail上传视频?

如果有人感兴趣,这是RecordingDetails对象的外观:
Google_Service_YouTube_VideoRecordingDetails Object
(
[locationType:protected] => Google_Service_YouTube_GeoPoint
[locationDataType:protected] =>
[locationDescription] =>
[recordingDate] => 2016-08-02T21:17:00.000Z
[internal_gapi_mappings:protected] => Array
(
)

[modelData:protected] => Array
(
)

[processed:protected] => Array
(
)

[location] => Google_Service_YouTube_GeoPoint Object
(
[altitude] =>
[latitude] => 36.527294814546
[longitude] => 128.5400390625
[internal_gapi_mappings:protected] => Array
(
)

[modelData:protected] => Array
(
)

[processed:protected] => Array
(
)

)

)

谢谢,
克里斯多夫

最佳答案

改变这个

$youtube->videos->insert('status,snippet', $video);

对此
$youtube->videos->insert('status,snippet,recordingDetails', $video);

如有需要,请交换插入内容以进行更新。

关于php - YouTube API PHP V3:使用RecordingDetails上传(Google API Client V2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38809578/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com