Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: Can server tell I'm using curl?
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Gilles via curl-users <curl-users_at_cool.haxx.se>
Date: Tue, 6 Apr 2021 16:24:20 +0200
Thanks much, it worked.
For others' benefit, and since Curl apparently can only download a
single file at a time, I added the wget version :
curl.exe -L -b cookies.firefox.txt
"https://www.acme.net/attachment.php?attachmentid=123&d=456" -H
"User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:87.0) Gecko/20100101
Firefox/87.0" -o mypic.jpg
wget --content-disposition --no-check-certificate
--header="Accept-Language: en;q=0.8,en-US;q=0.7,en;q=0.6"
--header="Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
--load-cookies=cookies.firefox.txt --header="User-Agent: Mozilla/5.0
(Windows NT 6.1; rv:87.0) Gecko/20100101 Firefox/87.0" -i pics.txt
On 06/04/2021 15:43, David Colter via curl-users wrote:
> Hello,
>
>> On Apr 6, 2021, at 7:37 AM, Gilles via curl-users
>> <curl-users_at_cool.haxx.se <mailto:curl-users_at_cool.haxx.se>> wrote:
>>
>> As you can see, I first used Firefox to log on, and used an extension
>> to export the cookies.
>>
>> Is the command wrong, or is the server somehow able to tell I'm using
>> curl to forbid its use? I'm having the same problem with wget (but it
>> might not understand the cookies file.)
>>
> You used a user-agent string and the server will not know that you are
> using cURL.
>
> Since you are exporting the cookies, you are making an unautomated
> task. Let cURL and your script handle cookies for you. Read about
> this here. <https://curl.se/docs/http-cookies.html>
>
> I would recommend that you use Firefox to perform the login request
> and picture request, then explore the Network tab of Web Developer
> Tools. There, you can alternate (right) click on the request, chose
> Copy > Copy as cURL.
>
> David
>
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-04-06
Date: Tue, 6 Apr 2021 16:24:20 +0200
Thanks much, it worked.
For others' benefit, and since Curl apparently can only download a
single file at a time, I added the wget version :
curl.exe -L -b cookies.firefox.txt
"https://www.acme.net/attachment.php?attachmentid=123&d=456" -H
"User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:87.0) Gecko/20100101
Firefox/87.0" -o mypic.jpg
wget --content-disposition --no-check-certificate
--header="Accept-Language: en;q=0.8,en-US;q=0.7,en;q=0.6"
--header="Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
--load-cookies=cookies.firefox.txt --header="User-Agent: Mozilla/5.0
(Windows NT 6.1; rv:87.0) Gecko/20100101 Firefox/87.0" -i pics.txt
On 06/04/2021 15:43, David Colter via curl-users wrote:
> Hello,
>
>> On Apr 6, 2021, at 7:37 AM, Gilles via curl-users
>> <curl-users_at_cool.haxx.se <mailto:curl-users_at_cool.haxx.se>> wrote:
>>
>> As you can see, I first used Firefox to log on, and used an extension
>> to export the cookies.
>>
>> Is the command wrong, or is the server somehow able to tell I'm using
>> curl to forbid its use? I'm having the same problem with wget (but it
>> might not understand the cookies file.)
>>
> You used a user-agent string and the server will not know that you are
> using cURL.
>
> Since you are exporting the cookies, you are making an unautomated
> task. Let cURL and your script handle cookies for you. Read about
> this here. <https://curl.se/docs/http-cookies.html>
>
> I would recommend that you use Firefox to perform the login request
> and picture request, then explore the Network tab of Web Developer
> Tools. There, you can alternate (right) click on the request, chose
> Copy > Copy as cURL.
>
> David
>
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-04-06