Sha256: addf7faa6a5c59405205859ac8a16af107bf80427b46917f6b89d6c241f61ba1

Contents?: true

Size: 614 Bytes

Versions: 15

Compression:

Stored size: 614 Bytes

Contents

require 'webradio'

class SeasideCommnunications < WebRadio
	def download(name)
		html = open(@url, &:read)
		playlist_url, serial = html.scan(%r[(http:.*?\_(\d+).wax)]).flatten
		unless playlist_url
			raise WebRadio::DownloadError.new("recent radio program not found.")
		end
		serial = serial.to_i

		playlist = open(playlist_url, &:read)
		wma_url, = playlist.scan(%r[http://.*?\.wma])

		@wma_file = "#{name}##{serial}.wma"
		@mp3_file = @wma_file.sub(/\.wma$/, '.mp3')
		mp3ize(@wma_file, @mp3_file) do
			open(@wma_file, 'wb:ASCII-8BIT') do |wma|
				wma.write(open(wma_url, &:read))
			end
		end
	end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rget-2.3.6 lib/seaside-c.rb
rget-2.3.5 lib/seaside-c.rb
rget-2.3.4 lib/seaside-c.rb
rget-2.3.3 lib/seaside-c.rb
rget-2.3.2 lib/seaside-c.rb
rget-2.3.1 lib/seaside-c.rb
rget-2.3.0 lib/seaside-c.rb
rget-2.2.4 lib/seaside-c.rb
rget-2.2.3 lib/seaside-c.rb
rget-2.2.2 lib/seaside-c.rb
rget-2.2.1 lib/seaside-c.rb
rget-2.2.0 lib/seaside-c.rb
rget-2.1.1 lib/seaside-c.rb
rget-2.1.0 lib/seaside-c.rb
rget-2.0.0 lib/seaside-c.rb