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.

Requires Python 3 and requests (pip install requests).

Run python itf.py to see all shows available for download.

Thanks tdragonite for original bash script.

import requests
import sys
import re
print('iTunes Festival London 2014 Downloader\n')
def shows_availabe():
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')]
for show in vods:
tag, artist = re.search('201409(\d{2})/v\d/(.*)_atv_vod\.m3u8', show['url']).groups()
print('{}\npython itf.py {} {}\n'.format(show['title'], tag, artist))
def download_show():
_, tag, artist = sys.argv
token = requests.get('http://itunes.apple.com/apps1b/authtoken/token.txt').text
cookies = {'token': token}
output = artist.split('_')[-1] + '.ts'
files_url = 'http://streaming.itunesfestival.com/auth/eu1/vod/201409{}/v1/8500_256/{}_vod.m3u8'.format(tag, 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))
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/8500_256/{}'.format(tag, 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) == 1:
shows_availabe()
else:
download_show()
@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