Skip to content

Instantly share code, notes, and snippets.

@tdragonite
Forked from badboy/HOWTO.md
Last active November 8, 2018 18:09
Show Gist options
  • Save tdragonite/b084d4af4beefbde7ef9 to your computer and use it in GitHub Desktop.
Save tdragonite/b084d4af4beefbde7ef9 to your computer and use it in GitHub Desktop.
iTunes Festival London 2014 show downloader

**
NEW VERSION (APPLE MUSIC FESTIVAL 2015 ALSO) & UPDATE HERE -> https://github.com/tdragonite/iTunesFestivalDownloader
**
iTunes Festival Show Downloader - London 2014

  1. Find the day of the show of the artist you want to download. Look at: http://www.itunesfestival.com
  2. Give execution permission to the script: chmod 777 itunes-festival.sh
  3. Launch the script: ./itunes-festival.sh day artist <br > Please, remember: NO SPACE IN THE ARTIST NAME!
    F.e: Tony Bennett = tonybennett, The Script = thescript. Thanks! <br > Examples: ./itunes-festival.sh 06 tonybennett <br > ./itunes-festival.sh 15 thescript <br >
  4. Have fun!
    Additional note:
    You can also force a specific artist id (this is useful for special artist combination, like Kate Simko and London Electronic Orchestra or for Placido Domingo, mistaken named plcidodomingo from Apple). <br > Find the artist id trought Google (search for "Kate Simko Itunes Store" and look at the artist id in the URL of the iTunes Store result) <br > Launch the script: ./itunes-festival.sh 01 katesimkolondonelectronicorchestra 76055920 <br >

Work also on OS X (remember: it isn't an Apple Script but a shell script: you need to use through Terminal). <br > Tnx to the original creator! <br > Tnx to sylvaingi for resume feature!

#!/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
output=${artist}_itf${tag}092014.ts
# Making temp directory
mkdir -p $artist
cd $artist
# Search artist id
if [[ -z "$3" ]]; then
api=$(curl -s "https://itunes.apple.com/search?term=$artist&entity=musicArtist&attribute=artistTerm&limit=1")
idartist=$(expr "$api" : '.*"artistId":\([^"]*\),')
else
idartist=$3
fi
# Fetching parts links
echo "iTunes Festival 2014 - Start download of ${artist} show ($tag/09/2014)"
index=$(curl -s -b "$cookie" http://streaming.itunesfestival.com/auth/eu6/vod/201409$tag/v1/${idartist}_${artist}_desktop_vod.m3u8 | tail -n1)
# Check if the input data are right.
if [[ $index =~ "</Message></Error>" ]]; then
echo "Error! Wrong day or artist name. Check the input parameters and remember: NO SPACE IN ARTIST NAME!"
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)
items=$(grep -o song <<< ${files[*]} | wc -l | tr -d ' ')
# Download parts
for i in $files; do
if [[ "$i" =~ "song" ]]; then
# Check if file already exist
if [[ ! -f $counter.ts ]]; then
echo "Downloading part $counter of $items"
# Check download status and exit if fail
until curl -m 600 -b "$cookie" http://streaming.itunesfestival.com/auth/eu6/vod/201409$tag/v1/8500_256/$i > $counter.ts; do
rm -f $counter.ts
echo "Failed to download. Try re-run the script for resume."
exit 1;
done
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."
@tdragonite
Copy link
Author

@melzinha No, I think you need only read the how to at the top of this page instead write asking help :-)

@tdragonite
Copy link
Author

Updated: no need of artist id. Only day and artist name (without space). Enjoy!

@TheMooseHut
Copy link

Great Work Guys thanks.

@Sprintlover
Copy link

Great script! I've downloaded couple of shows by now, but I can't download any of day 09! Sam Smith specifically. anyone knows why? this is what I get:
"./itunes-festival.sh 09 samsmith
iTunes Festival 2014 - Start download of samsmith show (09/09/2014)
Error! Wrong day or artist name. Check the input parameters and remember: NO SPACE IN ARTIST NAME!"

@tdragonite
Copy link
Author

@Sprintlover Lol, that's SO STRANGE. I'l look inside this strange thing :-P tnx for your report.

Edit: sorry, a very stuuuuuuupid bug in the cURL command for fetching the artist id! Fixed :-) download again the script.

@drtyhrry
Copy link

@tdragonlite, you've done an amazing job! Have you reached the limit of perfectness. or could you reach even further, e.a. have the script find the day?

@tdragonite
Copy link
Author

@drtyhrry lol, yes, it's possible, but this edition of iTunes Festival is almost finished.. so.. maybe the next year :-) I think it's not a big strain looking at the itunes festival website for the day :-P

@ians325
Copy link

ians325 commented Sep 29, 2014

Anyone got a list of feeds as ive tried to get KATE SIMKO ive tried 01 katesimko and 01 katesimkolondonelectronicorchestra no joy

@tdragonite
Copy link
Author

@ians325 Yah, because the script search the artist id for katesimkolondonelectronicorchestra and, obvsiouly, fail. Also, the feed use the artist id of "kate simko".
I've just update the script for you.
Re-download and force manually the artist id of Kate Simko.
./itunes-festival.sh 01 katesimkolondonelectronicorchestra 76055920
I've also updated the readme.

@isaaclcy
Copy link

isaaclcy commented Oct 1, 2014

Hi... it's great script, but I can't use it to download Placido Domingo video.

./itunes-festival.sh 30 placidodomingo

Would you please help

@daangijzen
Copy link

@tdragonite

I have the problem that when i run the script "./itunes-festival.sh 20 rudimental" it tels me:
"permission denied"

how do i get permission? and why

@tdragonite
Copy link
Author

@daangijzen because it's a shell script, if you didn't give the execution permission to it, you obvsiouly can't execute. Google is the answer if you don't know how to use terminal... btw:
chmod 777 itunes-festival.sh
and try to re-run the script.
@isaaclcy it's the same problem of Kate Sikmo that i've discussed some comments ago. In this case, Apple have written wrong the artist name in the feed (plcidodomingo instead of placidodomingo)
Fix it forcing the artist id and the feed name used by Apple using the latest version of the script:
./itunes-festival.sh 30 plcidodomingo 375956
It will work.

@axggame
Copy link

axggame commented Oct 1, 2014

tdragonite, can I please ask you a question: I've read all the comment and created the itunes-festival.sh file with your script, now when I try to run it with the chmod... and then the ./itunes.... command, it gives me, after the last command : "/bin/bash^M: bad interpreter: No such file or directory" now I am certain that the .sh file is there, and I tried it at several levels (e.g. home folder, documents folder, downloads folder) and it keeps giving me the same error
Can you please help me?

@tdragonite
Copy link
Author

@axggame the script is corrupted :-) search with Google, your find some information about ur error ;-)

@isaaclcy
Copy link

isaaclcy commented Oct 1, 2014

Understand. Thank you very much

@bvanpeski
Copy link

This is awesome. Great work!

@TwentyFifty
Copy link

Hi all, I'm trying to download the Foy Vance gig on the 29th. I get to the final stage of executing the script but the commands ".itunes-festival.sh 29 foyvance" and ".itunes-festival.sh 29 foyvance 68235486" return the error "-bash: .itunes-festival.sh: command not found" - I've checked the date and executed the permission so know it's finding the file but I can't work it out...any suggestions please?

@tdragonite
Copy link
Author

@TwentyFifty ahem... probably because it's ./itunes-festival.sh, with the slash. Like any other bash script in the world...

Thanks @bvp663 :-)

@TwentyFifty
Copy link

Thanks, it's my first time doing this and worked hard to learn everything else, just missed that mistake! Much appreciated.

@pisanggila
Copy link

// Never Mind
// I have it working now, I used: ./itunes-festival.sh 26 lennykravitz 160410

Thanks for the script!!

Just a little question: I am trying to download the Lenny Kravitz show (using: ./itunes-festival.sh 26 lennykravitz) but I am getting the error: "Error! Wrong day or artist name"

I already downloaded two other shows, Tony Bennett and Beck, so I got the script working :) (total newb here :p)

Am I doing something wrong?

@oriordanp
Copy link

Just wanted to add a comment to say "thanks" to all the people who contributed this.

@vinyldust
Copy link

Big thanks for the script tdragonite! - Worked Great!

@tdragonite
Copy link
Author

Tnx guys ;-)
@pisanggila sorry for the late answer. I've fixed this little bug, there was a problem with the iTunes API for the artist id search :-)

@DBRussell123456
Copy link

can u make one to download taylor swift the 1989 tour from apple music asap plz

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