Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download iTunes Festival streams
#!/bin/bash
#
# Download iTunes Festival streams
#
# 1. Open Wireshark, start a new Capture, filter by "http.cookie"
#
# 2. Open iTunes and play the Festival show you want
#
# 3. Look for "/auth/" items in your capture list.
# You need these to continue:
#
# a. The full URL of the .m3u8 you want
# b. The cookie associated with it
#
# 4. Split the URL up as per the example below, fill-in the "path"
# "input", and "output" variables at the top of the script
#
# 5. Fill-in the "cookie" variable too
#
# 6. Run the script, play the waiting game
#
#
# Example URL:
#
# http://streaming.itunesfestival.com/auth/farm6/vod/20140313/v1/8500_256/133036_soundgarden_vod.m3u8
#
path="http://streaming.itunesfestival.com/auth/farm6/vod/20140313/v1/8500_256/"
input="133036_soundgarden_vod.m3u8"
output="soundgarden.ts"
cookie=""
cache="/tmp/playlist.m3u8"
curl -b "$cookie" "$path$input" > "$cache"
playlist=`cat "$cache"`
# Download
for next_line in $playlist; do
if [[ "$next_line" =~ "act" ]]; then
# Trim
filename=`echo $next_line`
echo "Downloading: $filename"
curl -s -b "$cookie" "$path$filename" > $filename
fi
done
# Build
echo "Building: $output"
rm "$output"
touch "$output"
for next_line in $playlist; do
if [[ "$next_line" =~ "act" ]]; then
# Trim
filename=`echo $next_line`
cat "$filename" >> "$output"
mv "$filename" /tmp
fi
done
echo "Created: $output"
echo "Working files were moved to /tmp if you still want them"

Download iTunes Festival streams

  1. Open Wireshark, start a new Capture, filter by "http.cookie"

  2. Open iTunes and play the Festival show you want

  3. Look for "/auth/" items in your capture list. You need these to continue:

    1. The full URL of the .m3u8 you want
    2. The cookie associated with it
  4. Split the URL up as per the example below, fill-in the "path" "input", and "output" variables at the top of the script

  5. Fill-in the "cookie" variable too

  6. Run the script, play the waiting game

@Jakobud

This comment has been minimized.

Copy link

Jakobud commented Sep 25, 2015

Can't get this to work. I've got an Apple Music Festival stream and Wireshark gives me this:

/auth/eu1/vod/20150924/v1/8500_256/3726283_song1_7653.ts?token=expires=1443194102~access=/auth/*~md5=ea161b0dd2ed355fe463b4e8d21e09b5 HTTP/1.1 

What exactly is the "cookie" you need to fill in the script? I tried ea161b0dd2ed355fe463b4e8d21e09b5 but that didn't do anything. The script just stops after a few seconds and doesn't download anything.

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.