Sha256: 0c044b4575d70e5d6182d3afec4a5d66756c0a35c88b038c8be448bd0872b12a
Contents?: true
Size: 616 Bytes
Versions: 4
Compression:
Stored size: 616 Bytes
Contents
require 'webradio' require 'open3' class HLS < WebRadio private def hls_download(name, serial, m3u_meta) mp4_file = "#{name}##{serial}.mp4" mp3_file = "#{name}##{serial}.mp3" m3u = URI.open(m3u_meta, &:read).scan(/^[^#].*/).first m3u = Pathname(m3u_meta).dirname.join(m3u) if Pathname(m3u).relative? mp3nize(mp4_file, mp3_file) do result = Open3.capture3(%Q[ffmpeg -loglevel error -protocol_whitelist file,http,https,tcp,tls,crypto -i "#{m3u}" "#{mp4_file}"]) unless result[2].to_i == 0 raise WebRadio::DownloadError.new("failed download the radio program (#{@label}).") end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rget-4.12.0 | lib/hls.rb |
rget-4.11.0 | lib/hls.rb |
rget-4.10.0 | lib/hls.rb |
rget-4.9.3 | lib/hls.rb |