我有一个 php 代码来获取 youtube 验证码,但是当我提交验证码时,什么都不会发生。
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.youtube.com/das_captcha?next=/');
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'session.ck');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13 GTB7.1');
$a = curl_exec($ch);
if(preg_match('#Location: (.*)#', $a, $r)){
$l = trim($r[1]);
} ?>
谁能给我建议