首页 > 解决方案 > Youtube API - 允许订阅用户,但次日取走

问题描述

我们有一个产品可以在一个用户通过后订阅另一个用户,并给予我们这样做的完全许可。然后用户订阅了这些其他用户......您可以在执行 API 后在 youtube 中看到这一点(似乎成功)......但是一天后订阅者被删除并消失了?这一直运作良好。任何人都遇到过类似的问题或知道为什么在这里?

当使用具有完整权限范围的 API 时,我们将用户订阅到一个频道,我们会得到不同的结果:

Google_Service_YouTube_Subscription_Object 与有效数据一起返回

频道订阅https://www.youtube.com/subscribers?ar=2&o=U可能会或可能不会增加价值(顶部的计数器)

频道订阅者列表https://www.youtube.com/subscribers?ar=2&o=U未显示新用户(订阅者)

用户在他们的 Youtube 视图中显示他们订阅了频道

根据用户隐私设置显示用户对视频的评论

对视频点赞的用户会被计算在内

第二天:评论、订阅者数量从频道中删除,视频上的点赞数似乎保持不变

$youtube_client = new \Google_Client();
$youtube_client->setClientId(xxxx);
$youtube_client->setClientSecret(xxxx);
$youtube_client->setScopes(xxxx);
$youtube_client->setRedirectUri(xxxx);
$youtube = new \Google_Service_YouTube($youtube_client);
$resourceIdyt = new \Google_Service_YouTube_ResourceId();
$resourceIdyt->setChannelId($channel);
$resourceIdyt->setKind('youtube#channel');
$subscriptionSnippetyt = new \Google_Service_YouTube_SubscriptionSnippet();
$subscriptionSnippetyt->setResourceId($resourceIdyt);
$subscriptionyt = new \Google_Service_YouTube_Subscription();
$subscriptionyt->setSnippet($subscriptionSnippetyt);
$subscriptionResponse = $youtube->subscriptions->insert('id,snippet', $subscriptionyt, array());

标签: youtube-apiyoutube-data-api

解决方案


推荐阅读