curlconverter / curlconverter

Transpile curl commands into Python, JavaScript and 27 other languages
https://curlconverter.com
MIT License
7.17k stars 867 forks source link

curl to python does not converts #602

Closed RomaSdes closed 6 months ago

RomaSdes commented 6 months ago

When converting curl to python with curlconverter an error occurs. A curl im trying to convert:

curl "https://catalog.wb.ru/brands/x/catalog?TestGroup=control&TestID=348&appType=1&brand=19467&curr=rub&dest=-380705&sort=popular&spp=30&uclusters=3" ^
  -H "Accept: */*" ^
  -H "Accept-Language: ru,en;q=0.9" ^
  -H "Connection: keep-alive" ^
  -H "DNT: 1" ^
  -H "Origin: https://www.wildberries.ru" ^
  -H "Referer: https://www.wildberries.ru/brands/xiaomi" ^
  -H "Sec-Fetch-Dest: empty" ^
  -H "Sec-Fetch-Mode: cors" ^
  -H "Sec-Fetch-Site: cross-site" ^
  -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.931 YaBrowser/23.9.3.931 Yowser/2.5 Safari/537.36" ^
  -H "sec-ch-ua: ^\^"Chromium^\^";v=^\^"116^\^", ^\^"Not)A;Brand^\^";v=^\^"24^\^", ^\^"YaBrowser^\^";v=^\^"23^\^"" ^
  -H "sec-ch-ua-mobile: ?0" ^
  -H "sec-ch-ua-platform: ^\^"Windows^\^"" ^
  --compressed

An error:

Error: command should begin with "curl" but instead begins with "-H"
  -H "Accept: */*" ^
  ^^

Can you explain to me what am i doing wrong or fix malfunctioning that occurs in your program, please?

verhovsky commented 6 months ago

Press "copy as cURL (bash)" instead of "Copy as cURL (cmd)". You could also try replacing all ^ with \

curlconverter doesn't support windows cmd syntax. See #143