Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for reliably downloading binaries (e.g. Xcode) from Apple's CDN
#!/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)
@devedbox

This comment has been minimized.

Copy link

devedbox commented Aug 14, 2018

Awesome! It helps a lot.

@iNoles

This comment has been minimized.

Copy link

iNoles commented Jan 2, 2019

I think some MacOS versions broke file-allocation features.

@ensean

This comment has been minimized.

Copy link

ensean commented Mar 5, 2019

Great, for CN users especially

@JeromeBeckett

This comment has been minimized.

Copy link

JeromeBeckett commented Apr 17, 2019

Brilliant mate.

@n0an

This comment has been minimized.

Copy link

n0an commented Jun 4, 2019

what is ADCDownloadAuth ? how to get it?

@iandundas

This comment has been minimized.

Copy link
Owner Author

iandundas commented Jun 4, 2019

@lstomberg

This comment has been minimized.

Copy link

lstomberg commented Jun 19, 2019

This works great!!

@amoghpalnitkar

This comment has been minimized.

Copy link

amoghpalnitkar commented Sep 22, 2019

I think this no longer works. It gives me a 403 even after providing a valid cookie. Maybe apple has changed the authentication? God knows why.

@DrozNF

This comment has been minimized.

Copy link

DrozNF commented Nov 8, 2019

I too am getting the 403...

@thuss

This comment has been minimized.

Copy link

thuss commented Nov 22, 2019

It's working for me... I followed the instructions in this fork and the script above works fine: https://gist.github.com/manishpathak99/2a18fce18493f460fe80f2bd542a8560

@adauguet

This comment has been minimized.

Copy link

adauguet commented Nov 26, 2019

I had a 403, but managed to make it work by replacing https by http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.