JOCHLSDownloader (Ruby gem)

The JOCHLSDownloader ruby gem is a very simple native ruby code that downloads all files linked by a m3u8 manifest (used in HLS), I have used several times for test purposes.

  You can download the JOCHLSDownloader (Ruby version) from: Gem Version

Note:

  • For LIVE and EVENT playlist types it downloads only the firsts media segments.
  • For VOD playlist type it will download all media content.

 

Usage examples

require 'JOCHLSDownloader.rb'

#URL from HLS apple example
url = "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"
downloadpath = "./donloadtestfiles"
logfilename = "jochlsdownloader.log"

begin

hlsdownloader = CJOCHLSDownloader.new(url, downloadpath, logfilename, Logger::DEBUG)
hlsdownloader.startdownload
puts "End!"

rescue Exception => e

puts "Error: #{e.message}, Trace: #{e.backtrace.inspect}"

end

 

One thought on “JOCHLSDownloader (Ruby gem)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: