Skip to content

Instantly share code, notes, and snippets.

@banteg

banteg/readme.md Secret

Last active November 21, 2015 21:32
Show Gist options
  • 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)
@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