viddl 0.0.7 → 0.0.8
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/lib/viddl.rb +1 -1
- data/lib/viddl/video/download.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd33b2c5bcff4b999a13d30cd1977df8a7f31899
|
4
|
+
data.tar.gz: dfa1b3f7b6754937e04161f5c7e4724dd77e588f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851f28475638e1648ea05bf6060afe1f7a6a2adf6ce7d1733c2767e2ef39cb9f7d702a96daead7067fcc09ce024b4b7f5b2ef6b90f0b4c76fc7816c4a726cae6
|
7
|
+
data.tar.gz: 8a08108deac82d0f7f958764d94ad200173ec4712921e21ac3dc84322e66fde4e9434583555e654de184ed06f70e19742e919bce58b7838e4ed84d7040f56b5f
|
data/lib/viddl.rb
CHANGED
data/lib/viddl/video/download.rb
CHANGED
@@ -14,6 +14,7 @@ module Viddl
|
|
14
14
|
# Download the given video
|
15
15
|
# @param [Video::Instance] video
|
16
16
|
# @param [Hash] options
|
17
|
+
# @option options [String] :flags Flags to pass to youtube-dl
|
17
18
|
# @return [Download]
|
18
19
|
def self.process(video, options = {})
|
19
20
|
download = new(video)
|
@@ -29,9 +30,11 @@ module Viddl
|
|
29
30
|
|
30
31
|
# Download the video file
|
31
32
|
# @param [Hash] options
|
33
|
+
# @option options [String] :flags Flags to pass to youtube-dl
|
32
34
|
# @return [Boolean]
|
33
35
|
def process(options = {})
|
34
|
-
|
36
|
+
cmd = command_line(options)
|
37
|
+
result = Kernel.system(cmd)
|
35
38
|
raise(result.to_s) unless result
|
36
39
|
true
|
37
40
|
end
|
@@ -39,9 +42,11 @@ module Viddl
|
|
39
42
|
private
|
40
43
|
|
41
44
|
# Command line to download the video file
|
45
|
+
# @param [Hash] options
|
46
|
+
# @option options [String] :flags Flags to pass to youtube-dl
|
42
47
|
# @return [String]
|
43
|
-
def command_line
|
44
|
-
"youtube-dl #{@video.source_url} #{FORMAT_ARG} -o '#{TEMPDIR}/#{@video.id}s.%(ext)s'"
|
48
|
+
def command_line(options = {})
|
49
|
+
"youtube-dl #{@video.source_url} #{FORMAT_ARG} #{options[:flags]} -o '#{TEMPDIR}/#{@video.id}s.%(ext)s'"
|
45
50
|
end
|
46
51
|
|
47
52
|
end
|