cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Http response with ssl curl from YouTube

From: Yi Min Yang <sceiler14_at_gmail.com>
Date: Tue, 28 Apr 2015 15:54:08 +0200

Hi Daniel

Thanks for your fast reply.

I just found the problem lying by Google and YouTube. They are forcing a
redirect to https. A workaround is to use this user agent : Mozilla/5.0
(Windows
NT 6.1; WOW64 rv:24.0) Gecko/20100101

So now Firefox or Chrome user agent string else you get https.
This fixes it on the console.
If you use a binding you need to do a bit more :

Set verify ssl host to 0 and peer to false.
Set user agent to the one above.
Set follow location to true.
Set http get to true.

Of course this is a big security issue as explained in the documentation so
use with caution.

Thanks again Daniel. Using your advice with -v I saw the header, then I
deleted the ssl bundle and saw the -k argument and came to this conclusion.

Regards
 Am 28.04.2015 14:29 schrieb "Daniel Stenberg" <daniel_at_haxx.se>:

> On Tue, 28 Apr 2015, Yi Min Yang wrote:
>
> curl --proto =http --proto-redir =http --user-agent "Mozilla/5.0 (Windows
>> NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90
>> Safari/537.36" -L -x http://foo.bar.proxy.com:8080
>> http://youtube.com/watch?v=youtubevideolink > test.html
>>
>> This one returns a “curl: (1) Protocol “https” not supported or disabled
>> in
>> libcurl”. I believe this error is wrong as curl –version shows https.
>>
>
> If you add -v I think you'll see a redirect to HTTPS there. And you
> explicitly tell curl to only allow redirects to HTTP.
>
> This one works but the response / content of my test.html contains https
>> links which I do not want.
>>
>
> curl simply outputs what the server sends.
>
> Is it possible to get a http response?
>>
>
> Ask your server operator about that.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-04-28