Skip to content

Instantly share code, notes, and snippets.

@DBRussell123456
Forked from banteg/readme.md
Last active August 29, 2015 14:06
Show Gist options
  • Save DBRussell123456/f64112dd7a53acf7bafa to your computer and use it in GitHub Desktop.
Save DBRussell123456/f64112dd7a53acf7bafa to your computer and use it in GitHub Desktop.

iTunes Festival London 2014 – Show Downloader

Requires Python and requests (pip install requests).

Usage:

python itf.py see this help

python itf.py shows see shows available for download

python itf.py <day> <artist> [quality] download specific show

Options:

quality 1080p, 720p or ac3 (default: 1080p)

Example:

To download AC3 audio stream for Kasabian, type

python itf.py 05 20478838_kasabian ac3

Note:

You can mux .ts and .ac3 with mkvmerge.


Shows available as of 18.09.2014:

Artist Command
Friend Within python itf.py 01 599207502_friendwithin
deadmau5 python itf.py 01 78011850_deadmau5
Kate Simko & London Electronic Orchestra python itf.py 01 76055920_katesimkolondonelectronicorchestra
Beck python itf.py 02 312095_beck
Jenny Lewis python itf.py 02 117038088_jennylewis
David Guetta python itf.py 03 5557599_davidguetta
Robin Schulz python itf.py 03 347433400_robinschulz
Clean Bandit python itf.py 03 463049461_cleanbandit
Charlie Simpson python itf.py 04 431245240_charliesimpson
5 Seconds of Summer python itf.py 04 538811449_5secondsofsummer
Kasabian python itf.py 05 20478838_kasabian
Tony Bennett python itf.py 06 484980_tonybennett
Imelda May python itf.py 06 206456819_imeldamay
Calvin Harris python itf.py 07 201955086_calvinharris
Kiesza python itf.py 07 301580396_kiesza
Robert Plant python itf.py 08 288062_robertplant
Luke Sital-Singh python itf.py 08 258535972_lukesitalsingh
SOHN python itf.py 09 564248557_sohn
Sam Smith python itf.py 09 156488786_samsmith
Jungle python itf.py 10 825833522_jungle
Pharrell Williams python itf.py 10 14934728_pharrellwilliams
Matthew Koma python itf.py 11 449191736_matthewkoma
Maroon 5 python itf.py 11 1798556_maroon5
Nick Gardner python itf.py 11 437945751_nickgardner
Nick Mulvey python itf.py 12 336322969_nickmulvey
Elbow python itf.py 12 3240611_elbow
Rae Morris python itf.py 13 512065585_raemorris
Paolo Nutini python itf.py 13 156669286_paolonutini
David Gray python itf.py 14 316381_davidgray
Lisa Hannigan python itf.py 14 435150355_lisahannigan
The Script python itf.py 15 277228393_thescript
Foxes python itf.py 15 476901652_foxes
Blondie python itf.py 16 1012882_blondie
Chrissie Hynde python itf.py 16 2673957_chrissiehynde
Eric Whitacre python itf.py 17 98293067_ericwhitacre
Gregory Porter python itf.py 17 3437037_gregoryporter

Thanks tdragonite for original bash script.

import requests
import sys
import re
print('iTunes Festival London 2014 Downloader\n')
QUALITY = {
'1080p': ('8500_256', '.ts'),
'720p': ('3500_256', '.ts'),
'ac3': ('448', '.ac3')
}
def usage():
print('''Usage:
python itf.py
python itf.py shows
python itf.py <day> <artist> [quality]
Options:
quality 1080p, 720p or ac3 (default: 1080p)''')
def shows_available():
print('Shows available to download:\n')
atv = requests.get('https://appletv.itunesfestival.com/1b/en-GB/gb.json').json()['video_dict']
vods = [atv[x] for x in atv if x.startswith('vod')]
shows = []
for show in vods:
tag, artist = re.search('201409(\d{2})/v\d/(.*)_atv_vod\.m3u8', show['url']).groups()
shows.append((show['title'], tag, artist))
shows = sorted(shows, key=lambda x: x[1])
for show in shows:
print('{}\npython itf.py {} {}\n'.format(*show))
def download_show(tag, artist, quality='1080p'):
stream, ext = QUALITY[quality]
token = requests.get('http://itunes.apple.com/apps1b/authtoken/token.txt').text
cookies = {'token': token}
output = artist.split('_')[-1] + ext
files_url = 'http://streaming.itunesfestival.com/auth/eu1/vod/201409{}/v1/{}/{}_vod.m3u8'.format(tag, stream, artist)
files = requests.get(files_url, cookies=cookies)
files = [i for i in files.text.splitlines() if not i.startswith('#')]
total = len(files)
print('Downloading {} parts to {}'.format(total, output))
open(output, 'w').close()
for c, part in enumerate(files, start=1):
print('Downlading part {}/{} {}'.format(c, total, part))
part_url = 'http://streaming.itunesfestival.com/auth/eu1/vod/201409{}/v1/{}/{}'.format(tag, stream, part)
data = requests.get(part_url, cookies=cookies)
with open(output, 'ab') as f:
f.write(data.content)
print('Done! Enjoy the show.')
if __name__ == '__main__':
if len(sys.argv) == 2:
shows_available()
elif len(sys.argv) == 3:
_, tag, artist = sys.argv
download_show(tag, artist)
elif len(sys.argv) == 4:
_, tag, artist, quality = sys.argv
if not quality in QUALITY:
print('Warning: unknown quality, defaulting to 1080p')
quality = '1080p'
download_show(tag, artist, quality=quality)
else:
usage()
@DBRussell123456
Copy link
Author

python itf.py 16 1012882_blondie

python itf.py 16 2673957_chrissiehynde

python itf.py 17 3437037_gregoryporter

python itf.py 17 98293067_ericwhitacre

python itf.py 18 471286553_jessieware

python itf.py 18 258535972_littledragon

python itf.py 19 350994798_SBTRKT

python itf.py 20 474022504_rudimental

python itf.py 20 704309129_jessglynne

python itf.py 21 1010602_ryanadams

python itf.py 21 370729254_firstaidkit

python itf.py 22 405360400_jessiej

python itf.py 22 369659529_jamesbay

python itf.py 23 649817_placebo

python itf.py 23 470748115_themirrortrap

python itf.py 24 432957499_benhoward

python itf.py 24 342260741_hozier

python itf.py 25 1392280_maryJ.blige

python itf.py 26 160410_lennykravitz

python itf.py 26 589384117_wolfalice

python itf.py 27 465031_kylie

python itf.py 27 396289469_MNEK

python itf.py 28 62470937_nicolabenedetti

python itf.py 28 272521575_milos

python itf.py 28 112130771_alisonbalsom

python itf.py 29 183313439_edsheeran

python itf.py 29 68235486_foyvance

python itf.py 30 375956_plácidodomingo

@Diegoland
Copy link

I was looking for a way to download the Mary J Blige concert, and finally found this. You can't even imagine how frustrating it is not to be able to do any single thing. The only thing that I could do is download and install Python. No way I can succeed in installing pip requests nor any other single thing. I'm new to all this and can't get to understand it. I only got the Syntax Error for everything... :((( Someone help me please.

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