jimmy_jukebox 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/load_jukebox +1 -1
- data/bin/play_jukebox +31 -8
- data/lib/jimmy_jukebox/artists.rb +4 -1
- data/lib/jimmy_jukebox/jukebox.rb +100 -44
- data/lib/jimmy_jukebox/song.rb +130 -53
- data/lib/jimmy_jukebox/song_loader.rb +4 -0
- data/lib/jimmy_jukebox/songs/ArchibaldCampBanjo.yml +21 -0
- data/lib/jimmy_jukebox/songs/CharlieChristian.yml +9 -8
- data/lib/jimmy_jukebox/songs/CharlieParker.yml +8 -6
- data/lib/jimmy_jukebox/songs/CliffordHayesJugBlowers.yml +16 -0
- data/lib/jimmy_jukebox/songs/Dixieland.yml +9 -0
- data/lib/jimmy_jukebox/songs/LouisArmstrong.yml +5 -0
- data/lib/jimmy_jukebox/songs/MilesDavis.yml +31 -0
- data/lib/jimmy_jukebox/songs/Ragtime.yml +15 -0
- data/lib/jimmy_jukebox/user_config.rb +42 -35
- data/lib/jimmy_jukebox/user_interface.rb +46 -28
- data/lib/jimmy_jukebox/version.rb +2 -1
- data/spec/jimmy_jukebox_spec.rb +158 -133
- data/spec/song_loader_spec.rb +0 -1
- data/spec/song_spec.rb +4 -4
- data/spec/spec_helper.rb +30 -6
- data/spec/user_config_spec.rb +32 -15
- metadata +86 -74
- data/bin/jload_jukebox +0 -3
- data/bin/jplay_jukebox +0 -16
data/bin/load_jukebox
CHANGED
data/bin/play_jukebox
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
if RUBY_ENGINE =~ /jruby/
|
|
4
|
+
begin
|
|
5
|
+
require 'spoon'
|
|
6
|
+
require 'readline'
|
|
7
|
+
rescue LoadError => e
|
|
8
|
+
if e.message =~ /spoon/
|
|
9
|
+
p "*** You must install the 'spoon' gem to use JimmyJukebox on JRuby ***"
|
|
10
|
+
exit
|
|
11
|
+
elsif e.message =~ /readline/
|
|
12
|
+
p "*** You must install 'readline' to use JimmyJukebox on JRuby ***"
|
|
13
|
+
exit
|
|
14
|
+
else
|
|
15
|
+
raise
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
else
|
|
19
|
+
begin
|
|
20
|
+
require 'readline'
|
|
21
|
+
require 'posix/spawn'
|
|
22
|
+
rescue LoadError => e
|
|
23
|
+
if e.message =~ /readline/
|
|
24
|
+
p "*** You must install 'readline' or the 'rb-readline' gem to use JimmyJukebox in Ruby ***"
|
|
25
|
+
exit
|
|
26
|
+
elsif e.message =~ /posix/ || e.message =~ /spawn/
|
|
27
|
+
p "*** You must install the 'posix-spawn' gem to use JimmyJukebox in Ruby ***"
|
|
28
|
+
exit
|
|
29
|
+
else
|
|
30
|
+
raise
|
|
31
|
+
end
|
|
32
|
+
end
|
|
10
33
|
end
|
|
11
34
|
|
|
12
|
-
lib = File.expand_path(File.dirname(__FILE__)
|
|
35
|
+
lib = File.expand_path('../lib', File.dirname(__FILE__))
|
|
13
36
|
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
|
14
37
|
require 'jimmy_jukebox'
|
|
15
38
|
include JimmyJukebox
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module Artists
|
|
2
2
|
|
|
3
3
|
JAZZ_ARTISTS = {
|
|
4
|
+
:acb => "archibald_camp_banjo",
|
|
4
5
|
:at => "art_tatum",
|
|
5
6
|
:as => "artie_shaw",
|
|
6
7
|
:bg => "benny_goodman",
|
|
@@ -10,7 +11,9 @@ module Artists
|
|
|
10
11
|
:cc => "charlie_christian",
|
|
11
12
|
:cp => "charlie_parker",
|
|
12
13
|
:ch => "coleman_hawkins",
|
|
14
|
+
:chjb => "clifford_hayes_jug_blowers",
|
|
13
15
|
:cb => "count_basie",
|
|
16
|
+
:dx => "dixieland",
|
|
14
17
|
:dg => "dizzy_gillespie",
|
|
15
18
|
:dr => "django_reinhardt",
|
|
16
19
|
:de => "duke_ellington",
|
|
@@ -37,7 +40,7 @@ module Artists
|
|
|
37
40
|
end
|
|
38
41
|
|
|
39
42
|
def value_to_yaml_file(value)
|
|
40
|
-
return value.to_s.capitalize unless value.to_s.match(/_/)
|
|
43
|
+
return value.to_s.capitalize + '.yml' unless value.to_s.match(/_/)
|
|
41
44
|
value.to_s.split("_").map! { |name_component| name_component.capitalize }.join("") + '.yml'
|
|
42
45
|
end
|
|
43
46
|
|
|
@@ -1,81 +1,137 @@
|
|
|
1
|
+
require 'jimmy_jukebox/user_config'
|
|
2
|
+
|
|
1
3
|
module JimmyJukebox
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
class Jukebox
|
|
4
6
|
|
|
5
|
-
class
|
|
7
|
+
class NoNewSongException < Exception; end
|
|
8
|
+
class NoCurrentSongException < Exception; end
|
|
9
|
+
class NoPreviousSongException < Exception; end
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
attr_accessor :current_song, :continuous_play
|
|
12
|
+
attr_writer :user_config, :previous_song, :next_song, :playing
|
|
8
13
|
|
|
14
|
+
def initialize(new_user_config = UserConfig.new, continuous_play = true)
|
|
15
|
+
self.user_config = new_user_config
|
|
16
|
+
self.continuous_play = continuous_play
|
|
9
17
|
end
|
|
10
18
|
|
|
11
|
-
def
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
def play_loop
|
|
20
|
+
loop do
|
|
21
|
+
if continuous_play && !playing?
|
|
22
|
+
p "Playing random song"
|
|
23
|
+
play_next_song
|
|
24
|
+
else
|
|
25
|
+
sleep 0.1
|
|
26
|
+
end
|
|
15
27
|
end
|
|
16
28
|
end
|
|
17
29
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
play_random_song
|
|
21
|
-
rescue SystemExit, Interrupt => e
|
|
22
|
-
terminate_current_song
|
|
23
|
-
puts "\nMusic terminated by user"
|
|
24
|
-
exit
|
|
25
|
-
end
|
|
30
|
+
def next_song
|
|
31
|
+
@next_song ? @next_song : random_song
|
|
26
32
|
end
|
|
27
33
|
|
|
28
|
-
def
|
|
29
|
-
|
|
34
|
+
def play_next_song
|
|
35
|
+
play_song(next_song)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def quit
|
|
39
|
+
disable_continuous_play
|
|
30
40
|
terminate_current_song
|
|
31
41
|
end
|
|
32
42
|
|
|
33
|
-
def
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
def playing?
|
|
44
|
+
@playing ||= false
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def previous_song
|
|
48
|
+
@previous_song || nil
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def replay_previous_song
|
|
52
|
+
if previous_song
|
|
53
|
+
p "Replaying #{previous_song.music_file}"
|
|
54
|
+
#terminate_current_song
|
|
55
|
+
play_song(previous_song)
|
|
37
56
|
else
|
|
38
|
-
raise "No
|
|
57
|
+
raise NoPreviousSongException, "No previous song"
|
|
39
58
|
end
|
|
40
59
|
end
|
|
41
60
|
|
|
42
|
-
def
|
|
43
|
-
|
|
61
|
+
def skip_song
|
|
62
|
+
enable_continuous_play
|
|
63
|
+
if current_song
|
|
64
|
+
p "Skipping #{current_song.music_file}"
|
|
65
|
+
#play_random_song
|
|
66
|
+
self.previous_song = current_song
|
|
67
|
+
self.current_song = nil
|
|
68
|
+
previous_song.terminate
|
|
69
|
+
self.playing = false
|
|
70
|
+
else
|
|
71
|
+
raise NoCurrentSongException, "No current_song"
|
|
72
|
+
end
|
|
44
73
|
end
|
|
45
74
|
|
|
46
|
-
def
|
|
47
|
-
|
|
75
|
+
def pause_current_song
|
|
76
|
+
current_song.pause
|
|
48
77
|
end
|
|
49
78
|
|
|
50
|
-
def
|
|
51
|
-
|
|
79
|
+
def unpause_current_song
|
|
80
|
+
current_song.unpause
|
|
52
81
|
end
|
|
53
82
|
|
|
54
|
-
def
|
|
83
|
+
def songs
|
|
55
84
|
user_config.songs
|
|
56
85
|
end
|
|
57
86
|
|
|
58
|
-
def
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
87
|
+
def random_song
|
|
88
|
+
raise NoNewSongException, "JimmyJukebox can't find any songs to play!" if songs.length == 0
|
|
89
|
+
Song.new( songs[rand(songs.length)] )
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def play_random_song
|
|
93
|
+
p "Inside play_random_song"
|
|
94
|
+
play_song(random_song)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def enable_continuous_play
|
|
98
|
+
self.continuous_play = true
|
|
99
|
+
p "Enabled continuous_play"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def disable_continuous_play
|
|
103
|
+
self.continuous_play = false
|
|
104
|
+
p "Disabled continuous_play"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def play_song(song)
|
|
108
|
+
terminate_current_song if current_song
|
|
109
|
+
self.playing = true
|
|
110
|
+
p "Setting current_song = #{song.music_file}"
|
|
111
|
+
self.current_song = song
|
|
112
|
+
current_song.play(user_config, self)
|
|
113
|
+
p "Finished playing"
|
|
114
|
+
self.previous_song = current_song
|
|
115
|
+
self.current_song = nil
|
|
116
|
+
self.playing = false
|
|
117
|
+
rescue Song::SongTerminatedPrematurelyException
|
|
118
|
+
p "Song ended prematurely"
|
|
64
119
|
end
|
|
65
120
|
|
|
66
|
-
def
|
|
67
|
-
if
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
121
|
+
def terminate_current_song
|
|
122
|
+
if current_song
|
|
123
|
+
p "Terminating #{current_song.music_file}"
|
|
124
|
+
current_song.terminate
|
|
125
|
+
self.previous_song = current_song
|
|
126
|
+
self.current_song = nil
|
|
127
|
+
self.playing = false
|
|
71
128
|
else
|
|
72
|
-
|
|
129
|
+
raise NoCurrentSongException, "No current_song"
|
|
73
130
|
end
|
|
74
131
|
end
|
|
75
132
|
|
|
76
|
-
def
|
|
77
|
-
@user_config
|
|
78
|
-
@user_config
|
|
133
|
+
def user_config
|
|
134
|
+
@user_config ||= UserConfig.new
|
|
79
135
|
end
|
|
80
136
|
|
|
81
137
|
end
|
data/lib/jimmy_jukebox/song.rb
CHANGED
|
@@ -2,105 +2,182 @@ module JimmyJukebox
|
|
|
2
2
|
|
|
3
3
|
class Song
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
class InvalidSongFormatException < Exception; end
|
|
6
|
+
class NoPlayingPidException < Exception; end
|
|
7
|
+
class UnsupportedSongFormatException < Exception; end
|
|
8
|
+
class CannotSpawnProcessException < Exception; end
|
|
9
|
+
class SongTerminatedPrematurelyException < Exception; end
|
|
10
|
+
|
|
11
|
+
attr_reader :music_file
|
|
12
|
+
attr_writer :paused
|
|
6
13
|
attr_accessor :player, :playing_pid
|
|
7
14
|
|
|
8
|
-
def initialize(
|
|
9
|
-
set_music_file(
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
def initialize(in_music_file)
|
|
16
|
+
set_music_file(in_music_file)
|
|
17
|
+
self.paused = false
|
|
18
|
+
self.playing_pid = nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def paused?
|
|
22
|
+
@paused
|
|
12
23
|
end
|
|
13
24
|
|
|
14
|
-
def set_music_file(
|
|
15
|
-
if
|
|
16
|
-
@music_file =
|
|
25
|
+
def set_music_file(in_music_file)
|
|
26
|
+
if in_music_file =~ /\.mp3$/i || in_music_file =~ /\.ogg$/i
|
|
27
|
+
@music_file = in_music_file
|
|
17
28
|
else
|
|
18
|
-
raise "
|
|
29
|
+
raise InvalidSongFormatException, "JimmyJukebox plays only .mp3/.ogg files. #{in_music_file} is not valid"
|
|
19
30
|
end
|
|
20
31
|
end
|
|
21
32
|
|
|
33
|
+
def grandchild_pid
|
|
34
|
+
# returns grandchild's pid if the child process spawns a grandchild
|
|
35
|
+
# if so, the child is probably "/bin/sh" and the grandchild is "mpg123" or similar
|
|
36
|
+
gpid = `ps h --ppid #{playing_pid} -o pid`.strip.to_i
|
|
37
|
+
gpid == 0 ? nil : gpid
|
|
38
|
+
end
|
|
39
|
+
|
|
22
40
|
def pause
|
|
23
|
-
|
|
41
|
+
self.paused = true
|
|
24
42
|
# jruby doesn't seem to handle system() correctly
|
|
25
43
|
# trying backticks
|
|
26
|
-
# system("kill -s STOP #{
|
|
27
|
-
|
|
44
|
+
# system("kill -s STOP #{playing_pid}") if playing_pid
|
|
45
|
+
if grandchild_pid
|
|
46
|
+
p "Pausing"
|
|
47
|
+
`kill -s STOP #{grandchild_pid}`
|
|
48
|
+
elsif playing_pid
|
|
49
|
+
p "Pausing"
|
|
50
|
+
`kill -s STOP #{playing_pid}`
|
|
51
|
+
else
|
|
52
|
+
raise NoPlayingPidException, "*** Can't pause song because can't find playing_pid #{playing_pid} ***"
|
|
53
|
+
end
|
|
28
54
|
end
|
|
29
55
|
|
|
30
56
|
def unpause
|
|
31
|
-
|
|
57
|
+
self.paused = false
|
|
32
58
|
# jruby doesn't seem to handle system() correctly
|
|
33
59
|
# trying backticks
|
|
34
|
-
#system("kill -s CONT #{
|
|
35
|
-
|
|
60
|
+
#system("kill -s CONT #{playing_pid}") if playing_pid
|
|
61
|
+
if grandchild_pid
|
|
62
|
+
p "Unpausing"
|
|
63
|
+
`kill -s CONT #{grandchild_pid}`
|
|
64
|
+
elsif playing_pid
|
|
65
|
+
p "Unpausing"
|
|
66
|
+
`kill -s CONT #{playing_pid}`
|
|
67
|
+
else
|
|
68
|
+
raise NoPlayingPidException, "*** Can't unpause song because can't find playing_pid #{playing_pid} ***"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def kill_playing_pid_and_children
|
|
73
|
+
grandpid = grandchild_pid
|
|
74
|
+
playpid = playing_pid
|
|
75
|
+
if grandpid
|
|
76
|
+
`kill #{grandpid}`
|
|
77
|
+
p "killed #{grandpid}"
|
|
78
|
+
end
|
|
79
|
+
`kill #{playpid}`
|
|
80
|
+
p "killed #{playpid}"
|
|
36
81
|
end
|
|
37
82
|
|
|
38
83
|
def terminate
|
|
39
|
-
|
|
40
|
-
#`killall #{
|
|
41
|
-
|
|
84
|
+
self.paused = false
|
|
85
|
+
#`killall #{player}`
|
|
86
|
+
self.player = nil
|
|
42
87
|
# killing processes seems problematic in JRuby
|
|
43
88
|
# I've tried several approaches, and nothing seems reliable
|
|
44
|
-
#Process.kill("SIGKILL"
|
|
45
|
-
#Process.kill("SIGTERM"
|
|
46
|
-
|
|
47
|
-
|
|
89
|
+
#Process.kill("SIGKILL",playing_pid) if playing_pid
|
|
90
|
+
#Process.kill("SIGTERM",playing_pid) if playing_pid
|
|
91
|
+
if playing_pid
|
|
92
|
+
kill_playing_pid_and_children
|
|
93
|
+
self.playing_pid = nil
|
|
94
|
+
else
|
|
95
|
+
raise NoPlayingPidException, "*** Can't terminate song because can't find playing_pid #{playing_pid} ***"
|
|
96
|
+
end
|
|
48
97
|
end
|
|
49
98
|
|
|
50
99
|
def set_player(user_config)
|
|
51
|
-
if
|
|
52
|
-
|
|
53
|
-
elsif
|
|
54
|
-
|
|
100
|
+
if music_file =~ /\.mp3$/i
|
|
101
|
+
self.player = user_config.mp3_player
|
|
102
|
+
elsif music_file =~ /\.ogg$/i
|
|
103
|
+
self.player = user_config.ogg_player
|
|
104
|
+
else
|
|
105
|
+
raise UnsupportedSongFormatException, "Attempted to play a file format this program cannot play"
|
|
55
106
|
end
|
|
56
|
-
raise "Attempted to play a file format this program cannot play" unless @player
|
|
57
107
|
end
|
|
58
108
|
|
|
59
|
-
def play(user_config)
|
|
109
|
+
def play(user_config, jukebox)
|
|
60
110
|
set_player(user_config)
|
|
61
111
|
process_status = play_with_player
|
|
62
|
-
process_status.exitstatus.to_i == 0 ? (
|
|
112
|
+
process_status.exitstatus.to_i == 0 ? (self.playing_pid = nil) : (raise SongTerminatedPrematurelyException, "Experienced a problem playing a song")
|
|
63
113
|
end
|
|
64
114
|
|
|
65
115
|
def play_with_player
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
116
|
+
p "Now playing '#{music_file}'"
|
|
117
|
+
p "Press Ctrl-C to stop the music and exit this program"
|
|
118
|
+
music_file_path = File.expand_path(music_file)
|
|
119
|
+
run_command(player, music_file_path)
|
|
120
|
+
p "playing_pid = " + playing_pid.to_s
|
|
121
|
+
#system_yield_pid(player, music_file_path) do |pid|
|
|
122
|
+
# self.playing_pid = pid
|
|
123
|
+
#end
|
|
124
|
+
#if running_jruby?
|
|
125
|
+
Process.waitpid(playing_pid) # Waits for a child process to exit, returns its process id, and sets $? to a Process::Status object
|
|
126
|
+
#else
|
|
127
|
+
# Process::waitpid(playing_pid)
|
|
128
|
+
#end
|
|
129
|
+
p "Stopped waiting"
|
|
130
|
+
$? # return Process::Status object with instance methods .stopped?, .exited?, .exitstatus
|
|
73
131
|
end
|
|
74
132
|
|
|
75
133
|
end
|
|
76
134
|
|
|
135
|
+
def running_jruby?
|
|
136
|
+
defined?(JRUBY_VERSION) || RUBY_ENGINE == 'jruby' || RUBY_PLATFORM == 'java'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def run_command(command, arg)
|
|
140
|
+
if running_jruby?
|
|
141
|
+
pid = Spoon.spawnp(command,arg)
|
|
142
|
+
else
|
|
143
|
+
begin
|
|
144
|
+
pid = POSIX::Spawn::spawn(command + ' ' + arg)
|
|
145
|
+
#pgid = Process.getpgid(pid)
|
|
146
|
+
#child = POSIX::Spawn::Child.new(command + ' ' + arg)
|
|
147
|
+
#pid = child.status.pid
|
|
148
|
+
|
|
149
|
+
# create and run block in subprocess (which will terminate with status 0), capture subprocess pid
|
|
150
|
+
#pid = Process.fork do
|
|
151
|
+
# exec(command + ' ' + arg) # replace new process with system call
|
|
152
|
+
# exit! 127 # exit process and return exit status 127; should never be reached
|
|
153
|
+
#end
|
|
154
|
+
rescue NotImplementedError
|
|
155
|
+
raise CannotSpawnProcessException, "*** Cannot play music because we found neither Spoon.spawnp (for JRuby) nor Process.fork (for MRI) ***"
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
self.playing_pid = pid
|
|
159
|
+
end
|
|
160
|
+
|
|
77
161
|
# make system call and get pid so you can terminate process
|
|
78
162
|
def system_yield_pid(command,arg)
|
|
79
163
|
# would like to use Process.respond_to?(:fork) but JRuby mistakenly returns true
|
|
80
|
-
if
|
|
164
|
+
if running_jruby?
|
|
81
165
|
pid = Spoon.spawnp(command,arg)
|
|
82
|
-
Process.waitpid(pid) # Waits for a child process to exit, returns its process id, and sets $? to a Process::Status object
|
|
83
166
|
else
|
|
84
167
|
begin
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
#
|
|
89
|
-
|
|
90
|
-
|
|
168
|
+
#spawn(command + ' ' + arg)
|
|
169
|
+
#pid = POSIX::Spawn::spawn(command + ' ' + arg)
|
|
170
|
+
|
|
171
|
+
# create and run block in subprocess (which will terminate with status 0), capture subprocess pid
|
|
172
|
+
pid = Process.fork do
|
|
173
|
+
exec(command + ' ' + arg) # replace new process with system call
|
|
174
|
+
exit! 127 # exit process and return exit status 127; should never be reached
|
|
175
|
+
end
|
|
91
176
|
rescue NotImplementedError
|
|
92
|
-
raise "***
|
|
177
|
+
raise CannotSpawnProcessException, "*** Cannot play music because we found neither Spoon.spawnp (for JRuby) nor Process.fork (for MRI) ***"
|
|
93
178
|
end
|
|
94
179
|
end
|
|
95
180
|
yield pid if block_given? # call block, passing in the subprocess pid
|
|
96
|
-
#if pid
|
|
97
|
-
# puts "pid: #{pid}"
|
|
98
|
-
# puts "current_song: #{Jukebox.current_song.inspect}"
|
|
99
|
-
#else
|
|
100
|
-
# puts "No process id (pid)!"
|
|
101
|
-
# raise "@current_song: #{Jukebox.current_song.inspect}"
|
|
102
|
-
#end
|
|
103
|
-
$? # return Process::Status object with instance methods .stopped?, .exited?, .exitstatus; see: http://www.ruby-doc.org/core/classes/Process/Status.html
|
|
104
181
|
end
|
|
105
182
|
|
|
106
183
|
end
|
|
@@ -94,6 +94,10 @@ module JimmyJukebox
|
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
check_downloaded_song_size(song_pathname)
|
|
97
|
+
rescue OpenURI::HTTPError
|
|
98
|
+
p "Warning: Could not download #{song_url}"
|
|
99
|
+
File.delete(song_pathname) if File.exists?(song_pathname)
|
|
100
|
+
return nil
|
|
97
101
|
end
|
|
98
102
|
|
|
99
103
|
def self.check_downloaded_song_size(song_pathname)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/BanjoSketch.mp3
|
|
3
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/BeautifulDreamer.mp3
|
|
4
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/Ciri-biri-binWaltz.mp3
|
|
5
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/DanceOfTheFireflies.mp3
|
|
6
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/DanceOfTheWoodenDolls.mp3
|
|
7
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/DixieChickenReel.mp3
|
|
8
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/GoldenBellPolka.mp3
|
|
9
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/JumpingJacks.mp3
|
|
10
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/JumpingJacks2.mp3
|
|
11
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/LightGayPolka.mp3
|
|
12
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/ListenToTheMockingbird.mp3
|
|
13
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/LittleToyTrain.mp3
|
|
14
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/MountGretnaMarch.mp3
|
|
15
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/SerenadeOfTheMandolins.mp3
|
|
16
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/SilverCrownScottische.mp3
|
|
17
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/TheDarkiesAwakening.mp3
|
|
18
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/TheDarktownCakewalk.mp3
|
|
19
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/TheFrogvilleBand.mp3
|
|
20
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/TheJerseyCarnivalMarch.mp3
|
|
21
|
+
- http://archive.org/download/A.l.CampPlaysTheBanjo/WatchHillMarch.mp3
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
- http://
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
- http://archive.org/download/CharlieChristian-SevenComeEleven/02.SevenComeEleven.mp3
|
|
3
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-AirmailSpecial.mp3
|
|
4
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-BluesInB.mp3
|
|
5
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-HoneysuckleRose1939.mp3
|
|
6
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-MyDaddyRocksMe1940.mp3
|
|
7
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-SevenComeEleven.mp3
|
|
8
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-StompinAtTheSavoy1941.mp3
|
|
9
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-SwingToTheBop1941.mp3
|
|
10
|
+
#- http://www.archive.org/download/CharlieChristian-01-08/CharlieChristian-WhollyCats.mp3
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
+
- http://archive.org/download/CharlieParker-MyOldFlame/CharlieParker-MyOldFlame.mp3
|
|
3
|
+
- http://www.archive.org/download/CharlieParker-Laura/06-Laura.mp3
|
|
4
|
+
- http://www.archive.org/download/CharlieParker-AllTheThingsYouAre/CharlieParker-AllTheThingsYouAre.mp3
|
|
5
|
+
- http://www.archive.org/download/CharlieParker-BodyAndSoul1943/CharlieParker-BodyAndSoul1943.mp3
|
|
6
|
+
- http://www.archive.org/download/CharlieParker-MyOldFlame/CharlieParker-MyOldFlame.mp3
|
|
7
|
+
- http://www.archive.org/download/CharlieParkerHazelScott-EmbraceableYou1943/CharlieParkerHazelScott-EmbraceableYou1943.mp3
|
|
8
|
+
- http://archive.org/download/CharlieParker-LoverMantakeA/14.LoverMantakeA.mp3
|
|
9
|
+
- http://archive.org/download/JazzBeBop/02Pista022.mp3
|
|
2
10
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-ANightInTunisia.mp3
|
|
3
11
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-Bebop.mp3
|
|
4
12
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-BilliesBounce.mp3
|
|
@@ -25,9 +33,3 @@
|
|
|
25
33
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-TheHymn1947.mp3
|
|
26
34
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-WhiteChristmas.mp3
|
|
27
35
|
- http://www.archive.org/download/CharlieParker-01-25/CharlieParker-YardbirdSuite.mp3
|
|
28
|
-
- http://www.archive.org/download/CharlieParker-Laura/06-Laura.mp3
|
|
29
|
-
- http://www.archive.org/download/CharlieParker-LoverMantakeA/14.LoverMantakeA.mp3
|
|
30
|
-
- http://www.archive.org/download/CharlieParker-AllTheThingsYouAre/CharlieParker-AllTheThingsYouAre.mp3
|
|
31
|
-
- http://www.archive.org/download/CharlieParker-BodyAndSoul1943/CharlieParker-BodyAndSoul1943.mp3
|
|
32
|
-
- http://www.archive.org/download/CharlieParker-MyOldFlame/CharlieParker-MyOldFlame.mp3
|
|
33
|
-
- http://www.archive.org/download/CharlieParkerHazelScott-EmbraceableYou1943/CharlieParkerHazelScott-EmbraceableYou1943.mp3
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-BarefootStomp.mp3
|
|
3
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-BlueGuitarStomp.mp3
|
|
4
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-ByeByeBlues.mp3
|
|
5
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-ClefClubStomp.mp3
|
|
6
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-DanceHallShuffle.mp3
|
|
7
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-EverybodyWantsMyTootelum.mp3
|
|
8
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-HeyIAmBlue.mp3
|
|
9
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-IfYouCantMakeItEasySweetMama.mp3
|
|
10
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-LoveBlues.mp3
|
|
11
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-NationalBlues.mp3
|
|
12
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-PleaseDontHollerMama.mp3
|
|
13
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-TryAndTreatHerRight.mp3
|
|
14
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-YoudBetterLeaveMeAloneSweetPapa.mp3
|
|
15
|
+
- http://archive.org/download/CliffordHayesDixielandJugBlowers-01-14/CliffordHayesDixielandJugBlowers-YoureTicklinMe.mp3
|
|
16
|
+
- http://archive.org/download/DixielandJugBlowersVcliffordHayes-MemphisShake1926/DixielandJugBlowersVcliffordHayes-MemphisShake1926.mp3
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
- http://archive.org/download/JackSheedysDixielandJazzBand-TigerRag/JackSheedysDixielandJazzBand-TigerRag.mp3
|
|
3
|
+
- http://archive.org/download/SamLaninsIpanaTroubadores-Dixieland/SamLaninsIpanaTroubadores-Dixieland.mp3
|
|
4
|
+
- http://archive.org/download/OlleSundhsDixielandBand-Panama/OlleSundhsDixielandBand-Panama.mp3
|
|
5
|
+
- http://archive.org/download/JudyGarland-DixielandBand1944/JudyGarland-DixielandBand1944.mp3
|
|
6
|
+
- http://archive.org/download/OriginalDixielandJazzBand-Medley/OriginalDixielandJazzBand-Medley.mp3
|
|
7
|
+
- http://archive.org/download/MamieSmith-GoinToDixieland/MamieSmith-GoinToDixieland.mp3
|
|
8
|
+
- http://archive.org/download/BobCrosbyBobcats-DixielandShuffle1936/BobCrosbyBobcats-DixielandShuffle1936.mp3
|
|
9
|
+
- http://archive.org/download/DickieValentine-KingOfDixieland1958/DickieValentine-KingOfDixieland1958.mp3
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
- http://archive.org/download/LouisArmstrong-comeBackSweetPapa/louisarmstrong-ComeBackSweetPapa.mp3
|
|
3
|
+
- http://archive.org/download/LouisArmstrongOrch-BlueAgain1931/LouisArmstrongOrch-BlueAgain1931.mp3
|
|
4
|
+
- http://archive.org/download/LouisArmstrongOrch-SweetheartsOnParade1931/LouisArmstrongOrch-SweetheartsOnParade1931.mp3
|
|
5
|
+
- http://archive.org/download/LouisArmstrong-WhatAWonderfulWorld_39/LouisArmstrong-WhatAWonderfulWorld.mp3
|
|
6
|
+
- http://archive.org/download/LouisArmstrongAllHisStars-struttinWithSomeBarbecue/LouisArmstrongAllHisStars-StruttinWithSomeBarbecue.mp3
|
|
2
7
|
- http://www.archive.org/download/LouisArmstrong-AccentuateThePositive1945/LouisArmstrong-AccentuateThePositive1945.mp3
|
|
3
8
|
- http://www.archive.org/download/LouisArmstrong-AdiosMuchachos1959/LouisArmstrong-AdiosMuchachos1959.mp3
|
|
4
9
|
- http://www.archive.org/download/LouisArmstrong-CestSiBon1962/LouisArmstrong-CestSiBon1962.mp3
|
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
---
|
|
2
|
+
- http://archive.org/download/MilesDavisPortia/MilesDavis-Tutu-03.Portia.mp3
|
|
3
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/01-SoWhat.mp3
|
|
4
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/01-SomedayMyPrinceWillCome.mp3
|
|
5
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/02-Oleo.mp3
|
|
6
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/02-SpringIsHere.mp3
|
|
7
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/03-NoBlues.mp3
|
|
8
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/03-Teo.mp3
|
|
9
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/04-IThoughtAboutYou.mp3
|
|
10
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/04-Walkin.mp3
|
|
11
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/05-EnAranjuezConTuAmoradagioFrom-conciertoDeAranjuez-.mp3
|
|
12
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/05-TheMeaningOfTheBlues-lament.mp3
|
|
13
|
+
- http://archive.org/download/MilesDavisAtCarnegieHall/06-NewRhumba.mp3
|
|
14
|
+
- http://archive.org/download/CookinWithTheMilesDavisQuintet/01MyFunnyValentine.mp3
|
|
15
|
+
- http://archive.org/download/CookinWithTheMilesDavisQuintet/03BluesByFive.mp3
|
|
16
|
+
- http://archive.org/download/CookinWithTheMilesDavisQuintet/04Airegin.mp3
|
|
17
|
+
- http://archive.org/download/CookinWithTheMilesDavisQuintet/05TuneUp_whenLightsAreLow.mp3
|
|
18
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/01ItNeverEnteredMyMind.mp3
|
|
19
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/02Four.mp3
|
|
20
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/03InYourOwnSweetWay.mp3
|
|
21
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/04TheThemetake1.mp3
|
|
22
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/05TranesBlues.mp3
|
|
23
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/06AhmadsBlues.mp3
|
|
24
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/07HalfNelson.mp3
|
|
25
|
+
- http://archive.org/download/WorkinWithTheMilesDavisQuintet1959/08TheThemetake2.mp3
|
|
26
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/01SurreyWithTheFringeOnTop.mp3
|
|
27
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/02SaltPeanuts.mp3
|
|
28
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/03SomethingIDreamedLastNight.mp3
|
|
29
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/04Diane.mp3
|
|
30
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/05WellYouNeednt.mp3
|
|
31
|
+
- http://archive.org/download/SteaminWithTheMilesDavisQuintet/06WhenIFallInLove.mp3
|
|
32
|
+
- http://archive.org/download/MilesDavis-SpanishKey1/MilesDavis-SpanishKey1.mp3
|
|
2
33
|
- http://www.archive.org/download/MilesDavis-InASilentWayitsAboutThatTime/MilesDavis-InASilentWayitsAboutThatTime.mp3
|
|
3
34
|
- http://www.archive.org/download/MilesDavis-IFallInLoveTooEasily/03.IFallInLoveTooEasily.mp3
|
|
4
35
|
- http://www.archive.org/download/MilesDavis-AllBlues/04-AllBlues.mp3
|