-
Star
(100)
You must be signed in to star a gist -
Fork
(19)
You must be signed in to fork a gist
-
-
Save iandundas/fabe07455e5216442a421922361f698c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby | |
print "What is the URL of your Apple Downloads resource?\nURL:" | |
url = gets.strip | |
print "What is the ADCDownloadAuth cookie token:\nADCDownloadAuth: " | |
token = gets.strip | |
command = "aria2c --header \"Host: adcdownload.apple.com\" --header \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" --header \"Upgrade-Insecure-Requests: 1\" --header \"Cookie: ADCDownloadAuth=#{token}\" --header \"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1\" --header \"Accept-Language: en-us\" -x 16 -s 16 #{url} -d ~/Downloads" | |
exec(command) |
#!/usr/bin/env ruby
print "What is the URL of your Apple Downloads resource?\nURL:"
url = gets.strip
print "What is the ADCDownloadAuth cookie token:\nADCDownloadAuth: "
token = gets.strip
command = <<~SHELL
aria2c \
--header "Host: adcdownload.apple.com" \
--header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
--header "Upgrade-Insecure-Requests: 1" \
--header "Cookie: ADCDownloadAuth=#{token}" \
--header "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1" \
--header "Accept-Language: en-us" \
--max-connection-per-server=16 \
--split=16 \
-d ~/Downloads \
--continue=true \
#{url}
SHELL
exec(command)
Changes
- Puts the shell command in a heredoc for readability.
- Used long argument on non-intuitive arguments...for understandability.
- Removed the escapes on the double-quotes within the command because it no longer seems necessary within a heredoc...so far so good.
- Added the continue argument, in case you want to pick up after a partial download via your browser.
Result
I can confirm, the above worked without modification.
After having downloaded 1/3rd of the way with Safari, I copied the partially downloaded Xcode_12.5.xip
from the .download
subfolder to the ~/Downloads folder a ran the above script. The download resumed without starting over. Completed download successfully passes integrity check.
Still works! Thank you;
macOS Catalina Version 10.15.7
MacBook Pro (Retina, 13-inch, Mid 2014)
@BrainCrumbz trying to download using https://download.developer.apple.com/Developer_Tools/Xcode_13.2.1/Xcode_13.2.1.xip
Getting status=403. can you please post correct URL?
never-mind, https to http worked for me.
There is a tool that work great without any pain to download xcode.
You can download, install & switch between different versions of installed xcode.
It's called xcodes - - > https://github.com/RobotsAndPencils/xcodes
Alternatively, I found out that using a VPN can greatly increase the download speeds while using the regular App Store. Using Mullvad for this but other providers are probably similar
You solved my problem that I spent 3 years on finding the answer.
FYI. The latest Apple developer portal (as of 2022-Jun-6th) does not seem to include the ADCDownloadAuth cookie.
Perfect, thank you much! Another fast method I have discovered is to retrieve the xip from the developer site, using a Safari browser and my iPhone's Personal Hotspot over Bluetooth.