サーバーから動画をアップロードするためにcurlを介してYouTubeに接続しました。以下は私のコードです
<?php
$youtube_email = "------------------------"; // Change this to your youtube sign in email.
$youtube_password = "----------------"; // Change this to your youtube sign in password.
$postdata = "Email=".$youtube_email."&Passwd=".$youtube_password."&service=youtube&source=Example";
$curl = curl_init("https://www.google.com/youtube/accounts/ClientLogin");
curl_setopt($curl, CURLOPT_HEADER, "Content-Type:application/x-www-form-urlencoded");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
$rr= curl_getinfo($curl);
$response = curl_exec($curl);
curl_close($curl);
print_r($response);
?
それは私の localhost で完全に機能していますが、私のサーバーでは次のエラーが発生しました。
Error=BadAuthentication Url=https://www.google.com/accounts/ServiceLogin?service=youtube#Email=xxxx@gmail.com
ここで何が問題なのですか?