Есть ли способ загрузить XCode с помощью curl или wget?
РЕДАКТИРОВАТЬ: Почему следующий фрагмент локон не работает?
Сначала я захожу на сайт Apple:
curl -d "theAccountName=USERNAME&theAccountPW=PASS" -c xcode-cookie
-A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
https://daw.apple.com//cgi-bin/WebObjects/DSAuthWeb.woa/104/wo/W1df7WQblBsLekQzvS1tJ0/0.5.3.1.1.2.1.1.3.1.1"
Затем я пытаюсь скачать файл:
curl -b xcode-cookie -c xcode-cookie -O -v -A
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
http://adcdownload.apple.com/ios/ios_sdk_4.0.2__final/xcode_3.2.3_and_ios_sdk_4.0.2.dmg
Однако я получаю 403 Запрещенную ошибку:
* About to connect() to adcdownload.apple.com port 80 (#0)
* Trying 60.254.148.16... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* Connected to adcdownload.apple.com (60.254.148.16) port 80 (#0)
> GET /ios/ios_sdk_4.0.2__final/xcode_3.2.3_and_ios_sdk_4.0.2.dmg HTTP/1.1
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
> Host: adcdownload.apple.com
> Accept: */*
> Cookie: myacinfo=foo; DefaultAppleID=bar; ds01=baz
>
< HTTP/1.1 403 Forbidden
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
< no-cache: Cache-Control
< no-store: Cache-Control
< Content-Type: text/html;charset=ISO-8859-1
< Date: Mon, 30 Aug 2010 05:30:42 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Connection: Transfer-Encoding
< Cache-Control: no-store
<
{ [data not shown]
100 1932 0 1932 0 0 7531 0 --:--:-- --:--:-- --:--:-- 8548* Connection #0 to host adcdownload.apple.com left intact
* Closing connection #0