2013-06-26 3 views
0

PHP를 사용하여 https://developers.google.com/youtube/2.0/developers_guide_protocol_deprecated을 어떻게 구현합니까?연결되지 않은 Google 계정과 YouTube 채널 연결

내가 뭘하려 : 그래도 난 access_token은 말이냐

<?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; 
?> 

.

답변

1

Associating an unlinked Google Account with a YouTube channel은 더 이상 API를 통해 사용할 수 없으므로 문서의 더 이상 사용되지 않는 섹션에 나와 있습니다.

Google 계정을 채널에 연결하라는 메시지를 표시하는 현재 방법은 https://developers.google.com/youtube/create-channel입니다. 해당 가이드는 모바일 중심이지만 사용자가 데스크톱의 https://www.youtube.com/create_channel으로 리디렉션되어 동일한 프로세스가 시작될 수 있습니다.

관련 문제