vidload 0.1.9 → 0.1.10
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/vidload/mp2t/api.rb +16 -4
- data/lib/vidload/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3416ba597c831a7d6e1460bc0447fee8577e758279e036e820ccd967d93d46ef
|
|
4
|
+
data.tar.gz: a6d4c4c9e5bc8447cf68335029d60ca156c98ef6fc7bacd066b2335ca0e6966b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0891fcda0f3d59ea64ce309f35fea44456185bf0c6d56765e3c6d6ca60160819d19428e2b065e55c5c14efd3a7ef5dffa712ae02861e4e098c2d6e8bb8fdef75'
|
|
7
|
+
data.tar.gz: d5406c2f3e81b23038402e9f249c2359a96dc89edeba437e8274a2c4ada88bf6f1207373ab3205a2c9604bcc88bf0af8d8443e2f483cf93647c5934d780df466
|
data/lib/vidload/mp2t/api.rb
CHANGED
|
@@ -24,10 +24,10 @@ module Vidload::Mp2t::Api
|
|
|
24
24
|
playwright_cli_path:,
|
|
25
25
|
video_referer:,
|
|
26
26
|
ts_seg_pattern:,
|
|
27
|
-
hls_index_pattern
|
|
27
|
+
hls_index_pattern:,
|
|
28
|
+
author_name:
|
|
28
29
|
)
|
|
29
30
|
raise ArgumentError, "video_url must be provided" unless video_url
|
|
30
|
-
raise ArgumentError, "video_name must be provided" unless video_name
|
|
31
31
|
raise ArgumentError, "hls_url must be provided" unless hls_url
|
|
32
32
|
raise ArgumentError, "master_playlist_name must be provided" unless master_playlist_name
|
|
33
33
|
raise ArgumentError, "playwright_cli_path must be provided" unless playwright_cli_path
|
|
@@ -36,7 +36,6 @@ module Vidload::Mp2t::Api
|
|
|
36
36
|
raise ArgumentError, "hls_index_pattern must be provided" unless hls_index_pattern
|
|
37
37
|
|
|
38
38
|
@video_url = video_url
|
|
39
|
-
@video_name = video_name
|
|
40
39
|
@hls_url = hls_url
|
|
41
40
|
@master_playlist_name = master_playlist_name
|
|
42
41
|
@playwright_cli_path = playwright_cli_path
|
|
@@ -44,6 +43,8 @@ module Vidload::Mp2t::Api
|
|
|
44
43
|
@ts_seg_pattern = ts_seg_pattern
|
|
45
44
|
@hls_index_pattern = hls_index_pattern
|
|
46
45
|
@max_lines = IO.console.winsize[0]
|
|
46
|
+
@author_name = author_name
|
|
47
|
+
@video_name = if @author_name then "#{@author_name}_#{video_name}" else nil end
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def self.from_argv
|
|
@@ -56,6 +57,7 @@ module Vidload::Mp2t::Api
|
|
|
56
57
|
video_referer: ARGV[5],
|
|
57
58
|
ts_seg_pattern: ARGV[6],
|
|
58
59
|
hls_index_pattern: ARGV[7],
|
|
60
|
+
author_name: ARGV[8],
|
|
59
61
|
)
|
|
60
62
|
end
|
|
61
63
|
|
|
@@ -82,6 +84,9 @@ module Vidload::Mp2t::Api
|
|
|
82
84
|
puts "\tmaster_playlist_name=#{@master_playlist_name}"
|
|
83
85
|
puts "\tplaywright_cli_path=#{@playwright_cli_path}"
|
|
84
86
|
puts "\tvideo_referer=#{@video_referer}"
|
|
87
|
+
puts "\tts_seg_pattern=#{@ts_seg_pattern}"
|
|
88
|
+
puts "\thls_index_pattern=#{@hls_index_pattern}"
|
|
89
|
+
puts "\tauthor_name=#{@author_name}"
|
|
85
90
|
end
|
|
86
91
|
|
|
87
92
|
def self.display_with_spinner(loading_msg = "Loading...")
|
|
@@ -100,7 +105,14 @@ module Vidload::Mp2t::Api
|
|
|
100
105
|
page.on("response", -> (resp) { listen_to_video_starts(resp) })
|
|
101
106
|
navigate_to_url(@video_url, page)
|
|
102
107
|
video_starter_callbacks.each do |callback|
|
|
103
|
-
callback.call(page)
|
|
108
|
+
res = callback.call(page)
|
|
109
|
+
if !@video_name && res[:video_name]
|
|
110
|
+
@video_name = res[:video_name]
|
|
111
|
+
end
|
|
112
|
+
if !@author_name && res[:author_name]
|
|
113
|
+
@author_name = res[:author_name]
|
|
114
|
+
@video_name = "#{@author_name}_#{@video_name}"
|
|
115
|
+
end
|
|
104
116
|
end
|
|
105
117
|
end
|
|
106
118
|
|
data/lib/vidload/version.rb
CHANGED