Skip to content

Instantly share code, notes, and snippets.

@sylvaingi
Forked from tdragonite/HOWTO.md
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sylvaingi/984dba67b99ac5ff9a26 to your computer and use it in GitHub Desktop.
Save sylvaingi/984dba67b99ac5ff9a26 to your computer and use it in GitHub Desktop.
  1. Find the id, name and day of the show for the artist you want to load, replace whitespace or other symbols with underscores. You can find all the information here: https://appletv.itunesfestival.com/1b/en-GB/gb.json looking in the source code or by searching the artist on iTunes through Google and taking the ID from the url (p.e. Tony Bennet: https://itunes.apple.com/us/artist/tony-bennett/id484980)

  2. Launch the script: ./itunes-festival.sh day id_artist

    Example: ./itunes-festival.sh 06 484980_tonybennett

  3. Have fun.

Working for iTunes Festival September 2014. Also on OS X. Tnx to the original creator!

#!/bin/bash
# iTunes Festival 2014 - Show Downloader
# Variables
cookie="token=$(curl -s http://itunes.apple.com/apps1b/authtoken/token.txt)"
tag=$1
artist=$2
counter=1
show=(${artist//_/ })
output=${show[1]}_itf${tag}092014.ts
# Making temp directory
mkdir -p $artist
cd $artist
# Fetching parts links
echo "iTunes Festival 2014 - Start download of ${show[1]} show ($tag/09/2014)"
index=$(curl -s -b "$cookie" http://streaming.itunesfestival.com/auth/eu6/vod/201409$tag/v1/${artist}_desktop_vod.m3u8 | tail -n1)
# Check if the input data are right.
if [[ $index =~ "</Message></Error>" ]]; then
echo "Error! Wrong day or artist id. Check the input parameters!"
cd ..
rm -r $artist
exit 1;
fi
# Fetching parts links
files=$(curl -s -b "$cookie" http://streaming.itunesfestival.com/auth/eu6/vod/201409$tag/v1/$index)
# Download parts
for i in $files; do
if [[ "$i" =~ "song" ]]; then
if [[ ! -f $counter.ts ]]; then
echo "Downloading: $i"
curl -b "$cookie" http://streaming.itunesfestival.com/auth/eu6/vod/201409$tag/v1/8500_256/$i > $counter.ts
fi
counter=$((counter+1))
fi
done
# Merging parts and move in parent directory
echo "Building: $output"
cat $( ls -1 *.ts | sort -n ) > $output
mv $output ../
cd ..
rm -r $artist
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment