Hey, I've been trying to figure this one out for the last 3 days...but no luck. Basically, I scrape YouTube Video ID's and i sometimes get hit with captchas due to "excessive traffic coming from my network". I would like that captcha to be passed thru and shown to that website visitor, who would need to enter that captcha and submit it on my site, and php will use sessions to submit the captcha on youtube's page. Can this be done using PHP and cURL? Any other suggestions will be appreciated.
Yes it can. Use cURL to grab the page contents, if you detect a captcha, retrieve the captcha image URL (simple parsing), and then use curl to download it to the local hard disk, and then show to the user. Alternatively, you may be able to use output the image using the URL on Youtube directly on to the page, but I have no knowledge as to how exactly Youtube manages it's Captcha. I'm guessing they would just use reCaptcha.
Thanks Alex! Here's the captcha on youtube's page: http://www.youtube.com/das_captcha I'm not sure how the image downloading would work. Do I need to create a session, or a cookie? If I download the image (aka access the captcha page) and display it to the visitor, they enter the letters and hit submit on my page, the server would try to submit the form but when it is submitted or makes another request to submit the page won't another image/captcha be displayed? or would I have to keep the captcha session open until the user enters the captcha?
Unfortunately, I haven't got any idea in this topic. Maybe this is useful to you: http://decaptcher.com/client/ (I don't know that support to Youtube Captcha.)
You would need to look into how the Captcha actually works with each of the sites, there must be some method each site is using to identify the post back be it a sessionID in a cookie or hidden field or something similar. With your postback to them with the user input you would need to ensure that the identifiers are also there/ available. We don't use PHP so cannot comment on cURL specifically but I would be surprised if PHP didn't have this sort of functionality available
It should be doable provided you send exactly the same post and header info as YouTube are expecting.
It is doable and had been doing it for last 2 years. Though requires some Smart coding ... not recommend for new comers. There is a lot more to it , You tube has recently changed security stuff added a token and now somehow a simply proxying with correct code gives Authorization Error. Anyhow i am too working on this , with not much luck ... my earlier version worked fine , but new one somehow is not working .
This is so simple, don't even listen to the people who say otherwise, they have no idea how it works. Easy - use PHP to grab the page contents, if you can detect the captcha, simply use curl to download it (retrieve the URL, send the curl request to that url, and saved the returned file as image.gif). Then output image.gif to the user. You'll need to configure curl to properly handle cookies - most of the time these captchas are session based, and the session id is returned in the form a cookie. When the user submits the captcha text, submit the HTTP request to the server with the captcha value (making sure you send the same cookie). There's no reason it won't work. You're mimicking a browser. Paypal won't have anything in place to block it, as you're not doing anything out of the ordinary.