As First i start work on yahoo and i got help from net.
This script first make login on yahoo ok its i give bad user name and password it give me output of yahoo login page. secondly it tooks parameter including accepting policy work ok and it take much time to upload video. thirdly and this one not working it send back me upload form where from i am uploading video no error show at all also on top its show this
HTTP/1.1 200 OK
Date: Mon, 24 Mar 2008 10:55:19 GMT
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Cache-Control: private
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
and the here is upload form of video uploading
and at then its show
si 0 <br>video.yahoo.com ..... <font color=green>Upload done!</font><br>
its showing no error in process of cURL but no video upload on my profile.
code is
$video="C:\\xampp\\htdocs\\usenet\\test\\Moeljaan.mpeg";
$title="Commercial";
$description="Its only a Commercial";
$tags="puppy furry cute";
$category = "Food";
$user="yahoo_id";
$pass="yahoo_password";
$url ="http://login.yahoo.com/config/login?.src=ym&.intl=us&.partner=&.done=http%3A%2F%2Fvideo.yahoo.com%2Fvideo%2Fupload%3Fei%3DUTF-8%26.scrumb%3D0&.src=vsu&.intl=us";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'my_cookie.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "login=$user&passwd=$pass&&submit=Sign In");
$bufu = curl_exec ($ch);
curl_close ($ch);
unset($ch);
echo $bufu;
///upload video
$doneurl = 'http://video.yahoo.com/video/studio?action=upload';
$errorurl= 'http://video.yahoo.com/video/upload';
$postdata=array();
$postdata['_doneUrl']='http://video.yahoo.com/video/studio?action=upload';
$postdata['_errorUrl'] = 'http://video.yahoo.com/video/upload';
//http://video.yahoo.com/upload?
$postdata['Author'] = $user;
$postdata['MAX_FILE_SIZE'] = '104857600';
$postdata['Region'] = 'us';
$postdata['Channels'] = '3260013';
$postdata['ClientID'] = $user;
$postdata['_crumb'] = 'dfsgfdsgdsf';
$postdata['PartnerID']='yvideo';
$postdata['VIDEOFILE']="@$video";
$postdata['Title']="$title";
$postdata['Description']="$description";
$postdata['Categories']="$category";
$postdata['Tags']="$tags";
$postdata['submitquery']='Upload%20Video';
$postdata['vuform']="vuform";
////////////////////////
$postdata['follow']="1";
$postdata['numPostField']="16";
$postdata['Sig']="dfsgfdsgdsf";
////////////////////////
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Accept-Language: en-us,en;q=0.5";
$header[] = "Pragma: "; // browsers keep this blank.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://upload.video.yahoo.com/videoAPI/v1.0/Video.upload");
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookie.txt"); //initiates cookie file if needed
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookie.txt"); // Uses cookies from previous session if exist
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,TRUE); // follow redirects recursively
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
$buf=curl_exec ($ch);
$error_no = curl_errno($ch);
$buf=curl_exec ($ch);
curl_close ($ch);
unset($ch);
echo "$buf si $error_no <br>";
echo "video.yahoo.com ..... <font color=green>Upload done!</font><br>";
anybody can help me....?