Top Level Namespace

Includes:
FileUtils

Defined Under Namespace

Classes: ASXStream, Stream, StreamTrackRipper, Tags, Track, TrackFile, WatchedProcess, WatchedProcessGroup

Instance Method Summary collapse

Instance Method Details

#stream2tracks(argv) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/stream2tracks/cli.rb', line 5

def stream2tracks argv
    options=OpenStruct.new
    options.format='ogg'
    options.multi=false
    options.debug=false
    options.log=nil

    opts=OptionParser.new do |opts|
	opts.banner = 'Usage: stream2tracks [options] FILENAME|URL'

	opts.on('-d','--debug','Output debugging info.') do
	    options.debug=true
	end

	opts.on('-f','--format FORMAT','Convert tracks to FORMAT (default %s).' % options.format) do |format|
	    options.format=format
	end

	opts.on('-l','--log FILENAME','Log to FILENAME (or - for standard error).') do |filename|
	    options.log=filename
	end

	opts.on('-m','--multi','Download multiple tracks at once (EXPERIMENTAL).') do
	    options.multi=true
	end

	opts.on('-q','--quiet','Suppress output (progress bar).') do
	    options.quiet=true
	end

	opts.on_tail('-h', '--help', 'Show this message.') do
	    puts opts
	    exit
	end

	opts.on_tail('--version', 'Show version.') do
	    puts StreamTrackRipper::Version.join('.')
	    exit
	end
    end
    opts.parse! argv

    unless argv.size == 1
	puts opts
	exit
    end

    input_filename=argv.shift

    StreamTrackRipper.new(ASXStream.new(input_filename),options){}
end