Skip to content

Instantly share code, notes, and snippets.

@venj
Created October 24, 2011 02:22
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save venj/1308237 to your computer and use it in GitHub Desktop.
Save venj/1308237 to your computer and use it in GitHub Desktop.
Download "A Celebration of Steve's Life" from apple. http://events.apple.com.edgesuite.net/10oiuhfvojb23/event/index.html This script is based on previous WWDC keynote download script: https://gist.github.com/1012426
#!/usr/bin/env ruby
require 'open-uri'
if ["--help", "help", "-h"].include?(ARGV[0]) || ARGV.size < 1
puts "Usage: #{File.basename __FILE__} ( 540p | 540i | 360p | 360i | 360is | 224p )"
exit 0
end
size_hash = {"540p" => "2540", "540i" => "1840", "360p" => "1240", "360i" => "0640", "360is" => "0440", "224p" => "0240"}
video_size = size_hash[ARGV[0]]
outfilename = "celebrating_steve.ts"
File.unlink outfilename if File.exists? outfilename
if video_size
baseurl = "http://qthttp.apple.com.edgesuite.net/11ajdjnvkjnd10weoihf23ohfoihqw/"
outfile = open outfilename, 'w+'
puts baseurl + video_size + "/prog_index.m3u8"
listfile = open baseurl + video_size + "/prog_index.m3u8"
listfile.each_line do |line|
next if line =~ /^#/
file = line.strip.split("/").last
print "Downloading fragment file: #{file}..."
infile = open baseurl + "/#{video_size}/" + line.strip
outfile.write infile.read
infile.close
puts "Done"
end
outfile.close
else
puts "Wrong option."
exit 1
end
@azmoulai
Copy link

how can i use this git to download the celebrating video

@venj
Copy link
Author

venj commented Oct 29, 2011

You need Ruby. Which is included by OSX, or install on your windows or Linux box.
After installation, fire up command and run:

ruby down_celebrating_steve.rb 540p

@Kims0r
Copy link

Kims0r commented Jun 19, 2012

The Download went fine - very nice code, but how can I play the file?
Windows Media Player & VLC failed.
What can I use for W7 and OSX to play it?

@venj
Copy link
Author

venj commented Jun 20, 2012

Try kmplayer(free) on Windows, and MplayerX on OS X (available free in Mac App Store).

Or if you have ffmpeg installed, you can use it to remux TS file into an M4V file and play it with QuickTime. Here is the sample command:

ffmpeg -i video.ts -c:a copy -c:v copy video.m4v

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