dqteh7347 2013-06-26 00:57 采纳率: 100%
浏览 33

将未关联的Google帐户与YouTube频道相关联

How do you implement https://developers.google.com/youtube/2.0/developers_guide_protocol_deprecated using PHP?

What I tried:

<?php
  $headers = array("PUT /feeds/api/users/default HTTP/1.1",
  "Host: gdata.youtube.com",
  "Content-Type: application/atom+xml",
  "Authorization: Bearer ACCESS_TOKEN",
  "X-GData-Key: key=DEVKEY",
  "Content-length: ".strlen($data),
  $curl = curl_init("https://gdata.youtube.com/feeds/api/users/default?v=2.1");
  curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_TIMEOUT, 10);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  curl_setopt($curl, CURLOPT_REFERER, true);
  curl_setopt($curl, CURLOPT_HEADER, 0);
  $returnxxx = curl_exec($curl);
  curl_close($curl);
  echo $returnxxx;
?>

I am missing ACCESS_TOKEN though.

  • 写回答

1条回答 默认 最新

  • donglan8870 2013-06-26 15:12
    关注

    Associating an unlinked Google Account with a YouTube channel is no longer possible via the API—that's why it's in the deprecated section of the documentation.

    The current way of prompting a user to link a Google Account to a channel is described at https://developers.google.com/youtube/create-channel That guide is mobile-focused, but the same process can be kicked off by redirected a user to https://www.youtube.com/create_channel on the desktop.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题