vidload 0.1.10 → 0.1.11
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/cli.rb +34 -0
- data/lib/vidload/mp2t/api.rb +14 -0
- data/lib/vidload/version.rb +1 -1
- data/lib/vidload.rb +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f49b5b5ccfd0249511e3d7d9f14e13409d8c578efc202351fd5ebc5d82bbeba
|
|
4
|
+
data.tar.gz: 88f6b50466ce36d590f1407ad8daecd0dddeee00c4739b9d315d9feab8a3293c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff4a4ecf10a0df9d1d339f1d7e2d2af8c033d967b98a137bea85c41e65179e15f28e031c0bbf9fb7eeda36c1c16d05870072c4f98739912cf04241c05bb546bc
|
|
7
|
+
data.tar.gz: 8867c690eaac5b3ecfa177e22b6d44699657ca50d99f820a71b0f50dda3db8b34c56df99ddcd37c7c2a6a00ead4eda672725daaa6a3c4dce601ee7a0681851b4
|
data/lib/vidload/cli.rb
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require "thor"
|
|
2
|
+
|
|
3
|
+
class Vidload::Cli < Thor
|
|
4
|
+
desc "mp2t VIDEO_URL", "download a mp2t containerized video"
|
|
5
|
+
method_option :video_name, type: :string, required: false
|
|
6
|
+
method_option :author_name, type: :string, required: false
|
|
7
|
+
method_option :hls_url, type: :string, required: true
|
|
8
|
+
method_option :master_playlist_name, type: :string, required: true
|
|
9
|
+
method_option :playwright_cli_path, type: :string, required: true
|
|
10
|
+
method_option :video_referer, type: :string, required: true
|
|
11
|
+
method_option :ts_seg_pattern, type: :string, required: true
|
|
12
|
+
method_option :hls_index_pattern, type: :string, required: true
|
|
13
|
+
def mp2t(video_url)
|
|
14
|
+
params = {
|
|
15
|
+
video_url: video_url,
|
|
16
|
+
video_name: options[:video_name],
|
|
17
|
+
hls_url: options[:hls_url],
|
|
18
|
+
master_playlist_name: options[:master_playlist_name],
|
|
19
|
+
playwright_cli_path: options[:playwright_cli_path],
|
|
20
|
+
video_referer: options[:video_referer],
|
|
21
|
+
ts_seg_pattern: options[:ts_seg_pattern],
|
|
22
|
+
hls_index_pattern: options[:hls_index_pattern],
|
|
23
|
+
author_name: options[:author_name]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
process_mp2t(params)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def process_mp2t(params)
|
|
32
|
+
raise NotImplementedError
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/vidload/mp2t/api.rb
CHANGED
|
@@ -61,6 +61,20 @@ module Vidload::Mp2t::Api
|
|
|
61
61
|
)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
def self.from_hash(hash)
|
|
65
|
+
new(
|
|
66
|
+
video_url: hash[:video_url],
|
|
67
|
+
author_name: hash[:author_name],
|
|
68
|
+
video_name: hash[:video_name],
|
|
69
|
+
hls_url: hash[:hls_url],
|
|
70
|
+
master_playlist_name: hash[:master_playlist_name],
|
|
71
|
+
playwright_cli_path: hash[:playwright_cli_path],
|
|
72
|
+
video_referer: hash[:video_referer],
|
|
73
|
+
ts_seg_pattern: hash[:ts_seg_pattern],
|
|
74
|
+
hls_index_pattern: hash[:hls_index_pattern],
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
64
78
|
# main func to be called in your own scripts defined under web/
|
|
65
79
|
def download_video(video_starter_callbacks: [])
|
|
66
80
|
Playwright.create(playwright_cli_executable_path: @playwright_cli_path) do |playwright|
|
data/lib/vidload/version.rb
CHANGED
data/lib/vidload.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vidload
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patacode <pata.codegineer@gmail.com>
|
|
@@ -52,6 +52,20 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '1.8'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: thor
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.5'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.5'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
70
|
name: rake
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -73,6 +87,7 @@ extensions: []
|
|
|
73
87
|
extra_rdoc_files: []
|
|
74
88
|
files:
|
|
75
89
|
- lib/vidload.rb
|
|
90
|
+
- lib/vidload/cli.rb
|
|
76
91
|
- lib/vidload/mp2t.rb
|
|
77
92
|
- lib/vidload/mp2t/api.rb
|
|
78
93
|
- lib/vidload/mp2t/remuxer.sh
|