step_sequencer 1.1.2 → 1.1.3
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.
- checksums.yaml +4 -4
- data/bin/step_sequencer +4 -0
- data/lib/step_sequencer.rb +8 -1
- data/lib/step_sequencer/repl.rb +9 -0
- data/lib/version.rb +2 -2
- data/lib/youtube_downloader.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bcdfb6761dadd8db2aac714ae3205070cfd1953
|
4
|
+
data.tar.gz: 6b91169ee39afdc44980f7bea1daebc8f2af308c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8fd037e47ef7df933593dc693c29bbad66d851395d313cc41fe0ff8b918d8f7835cdad05448eac5ad3570a5f7906053d5507d1a7dc981bbbc0b02b7a6ad6d06
|
7
|
+
data.tar.gz: ff1e429f0813d83794a3ab2c5f251f5da316817fa0cd9522f326e865cf16205309adbb4436f00f774c4565330038bb894e41bf93aba44b74a4a26f7d178c6b38
|
data/bin/step_sequencer
CHANGED
data/lib/step_sequencer.rb
CHANGED
@@ -13,6 +13,14 @@ class StepSequencer; end
|
|
13
13
|
refinements_file = Gem.find_files("step_sequencer/refinements.rb").shift
|
14
14
|
require refinements_file
|
15
15
|
|
16
|
+
# Also require the version file
|
17
|
+
version_file = Gem.find_files("version.rb").shift
|
18
|
+
require version_file
|
19
|
+
|
20
|
+
# Also require the youtube downloader
|
21
|
+
version_file = Gem.find_files("youtube_downloader.rb").shift
|
22
|
+
require version_file
|
23
|
+
|
16
24
|
# Add a little util method to access the refinements from other files.
|
17
25
|
class StepSequencer
|
18
26
|
def self.refinement(name)
|
@@ -21,7 +29,6 @@ class StepSequencer
|
|
21
29
|
end
|
22
30
|
|
23
31
|
# Require all ruby files in lib/step_sequencer, ordered by depth
|
24
|
-
# This loads the refinements file again but it's no big deal
|
25
32
|
Gem.find_files("step_sequencer/**/*.rb")
|
26
33
|
.sort_by { |path| path.count "/" }
|
27
34
|
.each &method(:require)
|
data/lib/step_sequencer/repl.rb
CHANGED
@@ -13,6 +13,11 @@ class StepSequencer::REPL
|
|
13
13
|
class Helpers
|
14
14
|
|
15
15
|
HelpSections = {
|
16
|
+
download: "
|
17
|
+
Usage: download #{"\"<youtube url>\"".blue}, #{"\"<out dir>\"".blue} #{"\"<filename>\"".blue}
|
18
|
+
- requires youtube-dl program to be installed on computer
|
19
|
+
- e.g. download 'http://youtube.com/asd', '~/Desktop', 'foo.mp3'
|
20
|
+
",
|
16
21
|
play: "
|
17
22
|
Usage: play #{"\"<path>\"".blue}
|
18
23
|
- plays the file in its own thread using mpg123
|
@@ -96,6 +101,10 @@ class StepSequencer::REPL
|
|
96
101
|
StepSequencer::SoundPlayer
|
97
102
|
end
|
98
103
|
|
104
|
+
def download(url, outpath, filename)
|
105
|
+
YoutubeDownloader.download_audio url, outpath, filename
|
106
|
+
end
|
107
|
+
|
99
108
|
def combine(paths)
|
100
109
|
builder.build(
|
101
110
|
sources: paths, effect: :Combine
|
data/lib/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
class YoutubeDownloader
|
2
|
+
|
3
|
+
def self.download_audio(url, outdir, filename)
|
4
|
+
system <<-SH
|
5
|
+
cd #{outdir} && \
|
6
|
+
youtube-dl \
|
7
|
+
--extract-audio \
|
8
|
+
--prefer-ffmpeg \
|
9
|
+
--audio-format mp3 \
|
10
|
+
--yes-playlist \
|
11
|
+
--output #{filename} \
|
12
|
+
--audio-quality 3 \
|
13
|
+
#{url} \
|
14
|
+
&>/dev/null
|
15
|
+
SH
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.download_playlist(url, outdir, filename)
|
19
|
+
system <<-SH
|
20
|
+
cd #{outdir} && \
|
21
|
+
youtube-dl \
|
22
|
+
--extract-audio \
|
23
|
+
--prefer-ffmpeg \
|
24
|
+
--audio-format mp3 \
|
25
|
+
--audio-quality 3 \
|
26
|
+
--output #{filename} \
|
27
|
+
#{url} \
|
28
|
+
&>/dev/null
|
29
|
+
SH
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: step_sequencer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- max pleaner
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/step_sequencer/tests.rb
|
111
111
|
- lib/step_sequencer/tests/test_cases.rb
|
112
112
|
- lib/version.rb
|
113
|
+
- lib/youtube_downloader.rb
|
113
114
|
homepage: http://github.com/maxpleaner/step_sequencer
|
114
115
|
licenses:
|
115
116
|
- MIT
|
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
131
|
version: 2.6.11
|
131
132
|
requirements: []
|
132
133
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.5.1
|
134
135
|
signing_key:
|
135
136
|
specification_version: 4
|
136
137
|
summary: step sequencer (music tool)
|