Skip to content

Instantly share code, notes, and snippets.

@Jakobud
Forked from shuckster/ itunes-festival.sh
Created September 25, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jakobud/45c782fe4f450988affb to your computer and use it in GitHub Desktop.
Save Jakobud/45c782fe4f450988affb to your computer and use it in GitHub Desktop.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment