Skip to content

Instantly share code, notes, and snippets.

@banteg

banteg/readme.md Secret

Last active November 21, 2015 21:32
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save banteg/105bfb581bfa5c738312 to your computer and use it in GitHub Desktop.
Save banteg/105bfb581bfa5c738312 to your computer and use it in GitHub Desktop.
Apple Music Festival 2015 – Show Downloader (1080p/AC3)
@Diegoland
Copy link

I tried and tried, but I can't seem to understand how to use this.. I've been through tutorials all day long, downloaded and installed python, but never accomplished to install pip requests nor anything else. I always got the SyntaxError. I was interested in the Mary J Blige show that seems nobody has yet downloaded. Can somebody help me with that? ...Please.. :(

@tuomitie
Copy link

tuomitie commented Oct 3, 2014

Diegoland: This is what I did on Windows. After installing Python, go to https://pip.pypa.io/en/latest/installing.html and download the get-pip.py file. Navigate to that folder in command prompt, type: python get-pip.py and then navigate to the folder in which you have saved this downloader script. Proceed with the instructions from this script's readme (I think the command to download the Mary J. Blige show would be: python itf.py 25 1392280_maryjblige).

Thanks a lot for this script, gents!

@banteg
Copy link
Author

banteg commented Oct 11, 2014

I've uploaded this script to PyPI to make installation easier, now it's: pip install itf.
Note, that if you install script this way, usage command will change from python itf.py to just itf.

@MrFloppie
Copy link

Hi,
I know I'm a little late to the 2014 party but I wanted to give it a try and installed Ubuntu for this script.
I got Python 3 and the requests installed but when I execute "pip install itf" in the Terminal I get an error message after a short while:
pip.log:
https://gist.github.com/MrFloppie/d8d98b5fda8b107d782e/download

Any help is greatly appreciated!

@banteg
Copy link
Author

banteg commented Oct 24, 2014

Hey! Good news for you, the script is still working.
Problem is that you are trying to install package system-wide and by default in ubuntu users don't have such permissions. If this what you want, you need to state it explicitly by adding sudo before command (like sudo pip install itf) to temporarily escalate your privileges. Alternatively, you could use virtualenv.

@MrFloppie
Copy link

Thank you for taking the time to help! The sudo install did the trick. Question: I tried "python itf.py ..." and it did work prior to the "proper" sudo install - are there any differences in functionality? I'm a beginner so I hope I'm not insulting anyone with such questions.
I also encountered the unicode bug (?) mentioned above when the list is hitting the first special character on September 28th albeit not using Windows:
https://gist.github.com/MrFloppie/2dbb75235674fb44abc6

@banteg
Copy link
Author

banteg commented Oct 24, 2014

There are no differences, it's just a matter of distribution. This "bug" is caused by the fact that system default Python version is 2.7 and script is written for Python 3 only. You can use any of these workarounds (though I haven't tested any of those):

  1. Download script and run it with Python 3 like python3 itf.py shows
  2. Install it like sudo pip3 install itf and run as itf shows
  3. Create virtualenv and install it there
virtualenv -p python3 itfenv
cd itfenv
source itfenvbin/activate
pip install itf
itf shows

@MrFloppie
Copy link

Thanks agsin! All peachy now :)

@banteg
Copy link
Author

banteg commented Oct 24, 2014

I've updated the script, now it runs fine under Python 2.7 too. Also updated the PyPI version. Upgrade like pip install -U itf

@MrFloppie
Copy link

Just wanted to say thank you again and post some feedback regarding the video files.
My primary objective was to make perfect standard .m4v/mp4 files (for various media players) that contain the AC3 track and can also be played with the iOS native video player app (so they also have to have an AAC track) without actual transcoding to avoid loss of quality.

  1. Windows: "TS Doctor" #1: Check the ts stream. Although no errors occured while downloading one stream was acually currupted, all OK after a re-download.
    TS Doctor #2: Demux the ts file, you'll get .264 video and .aac audio streams
  2. OS X: "Subler": Create a new file, the first track to be added is the video stream, then the AAC and finally the AC3 file. Ensure that everthing is set to "pass through" and save as a .m4v file.

The result will be playable in iTunes, on iDevices and Apple TV (tested 3rd generation) WITHOUT any loss of sync after pausing or seeking, even if the AC3 track is selected. Many users report sync problems, especially when using the AC3 streams. AirPlay also works fine if you have a fast and stable Wi-Fi connection, the 1080p versions use around 10 Mbps.

I've also tried tsMuxeR and MP4Tools but the combination of TS Doctor and Subler was the only one that produced "perfect" files.
Ironically no Apple hardware is able to play 23.976 fps video properly (various hardware and OS X limitations*)
*Haven't checked if Yosemite is finally able to output a clean 23.976 Hz video signal.

@banteg
Copy link
Author

banteg commented Oct 29, 2014

Thank you for very useful feedback!

@gitkasi
Copy link

gitkasi commented Oct 31, 2014

@banteg, i get it compiled and tried it with python 2.7 and 3.4 (windows)
in both cases, i get the following error under windows:

C:\Python27\Scripts>itf shows
iTunes Festival London 2014 Downloader

Traceback (most recent call last):
File "C:\Python27\Scripts\itf-script.py", line 9, in
load_entry_point('itf==1.3.0', 'console_scripts', 'itf')()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 339, in load_entry
_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2470, in load_entr
y_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2189, in load
raise ImportError("%r has no %r attribute" % (entry, attr))
ImportError: <module 'itf' from 'C:\Python27\Scripts\itf.pyc'> has no 'main' attribute

Any idea ?

@banteg
Copy link
Author

banteg commented Oct 31, 2014

Honestly, I have no idea how you got this error. The script works without installing, maybe try it that way. Save the first file from this gist and install requests library (pip install requests). Invoke as python itf.py shows and so on.

@guimatheus92
Copy link

Hi ! Can someone help me please ? I dont know nothing about phyton, and I dont know how to install pip install requests and the other thins, I just want to download Rudimental from Itunes Festival. PLEASE, HELP ME !

@MrFloppie
Copy link

Would you be so kind as to revamp the script for the upcoming "Apple Music Festival" (new name for the iTunes Festival) starting September 19th?

@banteg
Copy link
Author

banteg commented Sep 19, 2015

I will update the script when the first recordings become available.

@MrFloppie
Copy link

Thank you very much! I'm looking forward to it :)

@banteg
Copy link
Author

banteg commented Sep 20, 2015

This year it might be trickier than before as Apple now silently rejects trusted self-signed certificates.
Let's move the techincal discussion here.

@banteg
Copy link
Author

banteg commented Sep 20, 2015

I've updated the script for Apple Music Festival 2015, uploaded it to PyPI so it can be installed via pip and made a github project for those who want to perfect it.

@MrFloppie
Copy link

Working properly here, thank you!

Side note: Can you verify that the video frame rate has been changed to 29.970 fps from 23.976 fps as it had been the previous years?

@MrFloppie
Copy link

One wish for even improved functionality: Would it be possible to automatically add chapter markings to separate individual songs into the fused TS file?
During the download process you see "song2" and "song3" etc. so these details seem to be broadcasted.
Thanks again for your efforts!

@banteg
Copy link
Author

banteg commented Sep 21, 2015

Nice idea, I'll see what I can do.

@banteg
Copy link
Author

banteg commented Sep 21, 2015

Hey, I've added --chapters option (you can combine it with --dump to skip downloading), check it out, just update with pip install -U itf. You'll need to add song names manually and merge it with something like mkvmerge.

@DBRussell123456
Copy link

can u post the script to make a windows version in vb 2010?

@banteg
Copy link
Author

banteg commented Sep 21, 2015

This script works on any platform, not sure what you're asking.

@MrFloppie
Copy link

I think he or she is unaware of the fact that Python needs to manually installed on Windows.

I seem to have a bug with the latest version under Ubuntu x64 (latest version). The previous version of the script works fine however now I get the following after I issue the standard download:
"Traceback (most recent call last):
File "itf.py", line 3, in
import click
ImportError: No module named 'click'
"
To make sure nothing got lost in the update process I manually copied the content of the itf.py file hosted here into my locally stored one. I invoke a download with "python3 itf.py 19 elliegoulding" which as mentioned works fine with the previous version of itf.py.

Did I make any amateur mistakes?

@banteg
Copy link
Author

banteg commented Sep 22, 2015

I think you just need to run pip with sudo on Ubuntu (or use virtualenv). I've added click as dependency recently to show progress and to better deal with growing amount of options (updated readme here). click will be installed automatically if you install or upgrade via pip:

sudo pip install -U itf

Installer will create a binary, so the script could be invoked as itf from anywhere rather than python3 itf.py from its location. Also you can fix the error with sudo pip install click.

@banteg
Copy link
Author

banteg commented Sep 22, 2015

Also, I suggest moving the discussion here as Gist doesn't have any notification system and it's a bit annoying.
Even better, if you want prompt answer, you can Telegram me and I'll try to help.

@DBRussell123456
Copy link

i have it working and i mean can u post a script to make a software program in visual basic 2010? also can u make a script to download tv shows and movies from apple's servers for free ? like this code

@banteg
Copy link
Author

banteg commented Sep 22, 2015

No, it's neither possible nor legal.

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