ehbrs-tools 0.16.0 → 0.16.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ehbrs/runner/videos/probe.rb +3 -3
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/vg/wii/wit/parsers/dump.rb +10 -5
- data/lib/ehbrs/videos/file.rb +4 -8
- data/lib/ehbrs/videos/track.rb +5 -13
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +4 -2
- data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/invalid_extension.rb +2 -0
- data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -13
- data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +10 -10
- data/lib/ehbrs/videos/unsupported/profiles/base.rb +17 -3
- data/lib/ehbrs/videos/unsupported/profiles/philco.rb +5 -4
- data/vendor/aranha-parsers/Gemfile +5 -0
- data/vendor/aranha-parsers/aranha-parsers.gemspec +23 -0
- data/vendor/aranha-parsers/lib/aranha/parsers.rb +9 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/base.rb +79 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html.rb +11 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/base.rb +47 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/item.rb +24 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/item_list.rb +29 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node.rb +13 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node/base.rb +36 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/html/node/default.rb +126 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/invalid_state_exception.rb +8 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/patches.rb +11 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/patches/ofx_parser.rb +38 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address.rb +55 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/file.rb +31 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_get.rb +25 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/hash_http_post.rb +45 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +49 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_target_fixtures.rb +77 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/spec/source_target_fixtures_example.rb +78 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +7 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_address/http_get_spec.rb +21 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_address_spec.rb +74 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb +27 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.source.txt +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.target.html +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub2.source.html +1 -0
- data/vendor/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub3.target.yaml +1 -0
- data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +7 -0
- data/vendor/aranha-parsers/spec/spec_helper.rb +8 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition.rb +36 -31
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +83 -0
- data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +76 -0
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +15 -2
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +18 -40
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +23 -3
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +92 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb +17 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +58 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +12 -4
- data/vendor/eac_cli/lib/eac_cli/runner/exit.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +18 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +6 -1
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +14 -0
- data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +10 -0
- data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +140 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +17 -5
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +42 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +53 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +29 -1
- data/vendor/eac_docker/lib/eac_docker/container.rb +24 -0
- data/vendor/eac_docker/lib/eac_docker/images/coded.rb +39 -0
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +26 -0
- data/vendor/eac_docker/lib/eac_docker/registry.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +12 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +17 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb +60 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +2 -50
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +52 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +31 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +53 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +4 -69
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +81 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +7 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +27 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +4 -6
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +33 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +24 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +0 -21
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +2 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +7 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +3 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb +28 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +30 -17
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +66 -8
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +12 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container.rb +30 -2
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/convert_job.rb +91 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +51 -0
- metadata +92 -13
- data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +0 -127
- data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +0 -38
- data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +0 -77
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container/file.rb +0 -31
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container/info.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dc9f681502aa982f3b5f9858770ca29aaf4d993495bf29fdc59e6393a517a47
|
4
|
+
data.tar.gz: 99b2ab99b50446770660561475f1f164e52bd6728b0532423db5062a1ef622ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e55b14db254112bc093cb6d1b16c590cd21fcfa626d8969eb7d9c672d6652c4c08be83c4e7152bd715ed4b9105b9164d7529471b87ceeb48ca88880237bd5849
|
7
|
+
data.tar.gz: a5c2dc9b6fc43cb397ed01aa7ddbba7d3d466507a1974b4c24d9b68b71285e2e666be34c92935f1a467b20a6f963afde0136fe5968989c719468bb8d7ee42bb8
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_cli/core_ext'
|
4
|
-
require 'ehbrs_ruby_utils/videos/container
|
4
|
+
require 'ehbrs_ruby_utils/videos/container'
|
5
5
|
require 'eac_ruby_utils/yaml'
|
6
6
|
|
7
7
|
module Ehbrs
|
@@ -18,13 +18,13 @@ module Ehbrs
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def output_content
|
21
|
-
::EacRubyUtils::Yaml.dump(container_file.
|
21
|
+
::EacRubyUtils::Yaml.dump(container_file.probe_data)
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def container_file_uncached
|
27
|
-
::EhbrsRubyUtils::Videos::Container
|
27
|
+
::EhbrsRubyUtils::Videos::Container.new(parsed.file_path)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
data/lib/ehbrs/tools/version.rb
CHANGED
@@ -11,7 +11,11 @@ module Ehbrs
|
|
11
11
|
enable_simple_cache
|
12
12
|
common_constructor :output
|
13
13
|
|
14
|
-
|
14
|
+
# WIA/WII (v1.00,LZMA2.7@100) & Wii
|
15
|
+
# ISO/WII & Wii
|
16
|
+
# WBFS/WII & Wii
|
17
|
+
# ISO/GC & GameCube
|
18
|
+
FILE_DISC_TYPE_PATTERN = %r{\A(\S+)/(\S+)\s+(?:\(([^\)]+)\)\s+)?&\s+(\S+)\z}.freeze
|
15
19
|
|
16
20
|
private
|
17
21
|
|
@@ -42,10 +46,11 @@ module Ehbrs
|
|
42
46
|
end
|
43
47
|
|
44
48
|
def parse_file_disc_type(value)
|
45
|
-
FILE_DISC_TYPE_PATTERN
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
r = FILE_DISC_TYPE_PATTERN.match(value).if_present do |m|
|
50
|
+
{ type: m[1], platform_acronym: m[2], type_extra: m[3],
|
51
|
+
platform_name: m[4] }
|
52
|
+
end
|
53
|
+
r.if_blank { raise "\"#{FILE_DISC_TYPE_PATTERN}\" does not match \"#{value}\"" }
|
49
54
|
end
|
50
55
|
|
51
56
|
def parse_disc_part_ids(value)
|
data/lib/ehbrs/videos/file.rb
CHANGED
@@ -3,10 +3,11 @@
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
4
|
require 'ehbrs/videos/track'
|
5
5
|
require 'ehbrs_ruby_utils/executables'
|
6
|
+
require 'ehbrs_ruby_utils/videos/container'
|
6
7
|
|
7
8
|
module Ehbrs
|
8
9
|
module Videos
|
9
|
-
class File
|
10
|
+
class File < ::EhbrsRubyUtils::Videos::Container
|
10
11
|
enable_simple_cache
|
11
12
|
|
12
13
|
TIME_PATTERN = /(\d+):(\d{2}):(\d{2})(?:\.(\d+))/.freeze
|
@@ -39,17 +40,12 @@ module Ehbrs
|
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
|
-
common_constructor :path
|
43
|
-
|
44
43
|
private
|
45
44
|
|
46
45
|
def tracks_uncached
|
47
|
-
|
48
|
-
|
49
|
-
t = ::Ehbrs::Videos::Track.create_from_string(line)
|
50
|
-
r << t if t && t.type != 'Data'
|
46
|
+
streams.map { |stream| ::Ehbrs::Videos::Track.new(stream) }.reject do |t|
|
47
|
+
t.codec_type == ::EhbrsRubyUtils::Videos::Stream::CODEC_TYPE_DATA
|
51
48
|
end
|
52
|
-
r
|
53
49
|
end
|
54
50
|
|
55
51
|
def content_uncached
|
data/lib/ehbrs/videos/track.rb
CHANGED
@@ -1,25 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'ehbrs_ruby_utils/videos/stream'
|
4
5
|
|
5
6
|
module Ehbrs
|
6
7
|
module Videos
|
7
|
-
class Track
|
8
|
-
|
9
|
-
|
10
|
-
class << self
|
11
|
-
def create_from_string(string)
|
12
|
-
m = FFPROBE_PATTERN.match(string)
|
13
|
-
return nil unless m
|
14
|
-
|
15
|
-
new(m[1].to_i, m[3], m[2], m[4], m[5].strip)
|
16
|
-
end
|
8
|
+
class Track < ::SimpleDelegator
|
9
|
+
def extra
|
10
|
+
ffprobe_data.fetch(:codec_tag_string).to_s
|
17
11
|
end
|
18
12
|
|
19
|
-
common_constructor :number, :type, :language, :codec, :extra
|
20
|
-
|
21
13
|
def to_s
|
22
|
-
"[#{
|
14
|
+
"[#{codec_type}(#{index}): #{codec_name}/#{language || '-'}" +
|
23
15
|
extra.if_present('') { |v| " | #{v}" } + ']'
|
24
16
|
end
|
25
17
|
end
|
@@ -5,10 +5,12 @@ module Ehbrs
|
|
5
5
|
module Unsupported
|
6
6
|
module Checks
|
7
7
|
class CodecExtraUnlisted
|
8
|
+
TYPE = :stream
|
9
|
+
|
8
10
|
common_constructor :codec, :listed_extras
|
9
11
|
|
10
12
|
def check(track)
|
11
|
-
return nil unless track.
|
13
|
+
return nil unless track.codec_name == codec
|
12
14
|
return nil if listed_extras.any? do |extra|
|
13
15
|
track.extra.downcase.include?(extra.downcase)
|
14
16
|
end
|
@@ -7,10 +7,12 @@ module Ehbrs
|
|
7
7
|
module Unsupported
|
8
8
|
module Checks
|
9
9
|
class CodecExtraUnsupported
|
10
|
+
TYPE = :stream
|
11
|
+
|
10
12
|
common_constructor :codec, :extra
|
11
13
|
|
12
14
|
def check(track)
|
13
|
-
return nil unless track.
|
15
|
+
return nil unless track.codec_name == codec
|
14
16
|
return nil unless track.extra.downcase.include?(extra.downcase)
|
15
17
|
|
16
18
|
"Unsupported extra \"#{extra}\" for codec \"#{codec}\" and track #{track}"
|
@@ -5,12 +5,14 @@ module Ehbrs
|
|
5
5
|
module Unsupported
|
6
6
|
module Checks
|
7
7
|
class CodecUnlisted
|
8
|
+
TYPE = :stream
|
9
|
+
|
8
10
|
common_constructor :listed_codecs
|
9
11
|
|
10
12
|
def check(track)
|
11
|
-
return nil if listed_codecs.include?(track.
|
13
|
+
return nil if listed_codecs.include?(track.codec_name)
|
12
14
|
|
13
|
-
"Not listed codec \"#{track.
|
15
|
+
"Not listed codec \"#{track.codec_name}\" (Track: #{track}, listed: #{listed_codecs})"
|
14
16
|
end
|
15
17
|
|
16
18
|
def fix
|
@@ -7,10 +7,12 @@ module Ehbrs
|
|
7
7
|
module Unsupported
|
8
8
|
module Checks
|
9
9
|
class CodecUnsupported
|
10
|
+
TYPE = :stream
|
11
|
+
|
10
12
|
common_constructor :codec
|
11
13
|
|
12
14
|
def check(track)
|
13
|
-
return nil unless track.
|
15
|
+
return nil unless track.codec_name == codec
|
14
16
|
|
15
17
|
"Unsupported codec \"#{codec}\" for track #{track}"
|
16
18
|
end
|
@@ -35,19 +35,6 @@ module Ehbrs
|
|
35
35
|
video.tracks.flat_map(&:ffmpeg_fix_args)
|
36
36
|
end
|
37
37
|
|
38
|
-
def track_fix_args(track)
|
39
|
-
["#{track_codec_option_by_type(track.type)}:#{track.number}",
|
40
|
-
track.passed? ? 'copy' : track_codec_fix_by_type(track.type)]
|
41
|
-
end
|
42
|
-
|
43
|
-
def track_codec_option_by_type(track_type)
|
44
|
-
TRACK_TYPE_OPTIONS.fetch(track_type)
|
45
|
-
end
|
46
|
-
|
47
|
-
def track_codec_fix_by_type(track_type)
|
48
|
-
TRACK_TYPE_FIX_CODECS.fetch(track_type)
|
49
|
-
end
|
50
|
-
|
51
38
|
def container_fix_args
|
52
39
|
['-f', ::Ehbrs::Videos::Unsupported::Fixes::SupportedContainer::FIX_FORMAT]
|
53
40
|
end
|
@@ -6,28 +6,28 @@ module Ehbrs
|
|
6
6
|
module Fixes
|
7
7
|
class SupportedCodec
|
8
8
|
TRACK_TYPE_OPTIONS = {
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
audio: '-acodec',
|
10
|
+
video: '-vcodec',
|
11
|
+
subtitle: '-scodec'
|
12
12
|
}.freeze
|
13
13
|
|
14
14
|
TRACK_TYPE_FIX_CODECS = {
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
audio: 'libvorbis',
|
16
|
+
video: 'libx264',
|
17
|
+
subtitle: 'ass'
|
18
18
|
}.freeze
|
19
19
|
|
20
20
|
def ffmpeg_args(track)
|
21
|
-
["#{track_codec_option_by_type(track.
|
22
|
-
track_codec_fix_by_type(track.
|
21
|
+
["#{track_codec_option_by_type(track.codec_type)}:#{track.index}",
|
22
|
+
track_codec_fix_by_type(track.codec_type)]
|
23
23
|
end
|
24
24
|
|
25
25
|
def track_codec_option_by_type(track_type)
|
26
|
-
TRACK_TYPE_OPTIONS.fetch(track_type)
|
26
|
+
TRACK_TYPE_OPTIONS.fetch(track_type.to_s.underscore.to_sym)
|
27
27
|
end
|
28
28
|
|
29
29
|
def track_codec_fix_by_type(track_type)
|
30
|
-
TRACK_TYPE_FIX_CODECS.fetch(track_type)
|
30
|
+
TRACK_TYPE_FIX_CODECS.fetch(track_type.to_s.underscore.to_sym)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -19,13 +19,21 @@ module Ehbrs
|
|
19
19
|
added_checks << check_path.camelize.constantize.new(*args)
|
20
20
|
end
|
21
21
|
|
22
|
+
def base_checks
|
23
|
+
[unlisted_codec_check] + unsupported_codec_checks +
|
24
|
+
supported_codecs.flat_map { |codec| codec_extra_checks(codec) }
|
25
|
+
end
|
26
|
+
|
27
|
+
def checks
|
28
|
+
base_checks + added_checks
|
29
|
+
end
|
30
|
+
|
22
31
|
def file_checks
|
23
|
-
|
32
|
+
checks.select { |c| check_type(c) == :container }
|
24
33
|
end
|
25
34
|
|
26
35
|
def track_checks
|
27
|
-
|
28
|
-
supported_codecs.flat_map { |codec| codec_extra_checks(codec) }
|
36
|
+
checks.select { |c| check_type(c) == :stream }
|
29
37
|
end
|
30
38
|
|
31
39
|
def codec_extra_checks(codec)
|
@@ -95,6 +103,12 @@ module Ehbrs
|
|
95
103
|
def codec_supported_extras(codec)
|
96
104
|
codec_extras(codec, 'supported')
|
97
105
|
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def check_type(check)
|
110
|
+
check.class.const_get(:TYPE)
|
111
|
+
end
|
98
112
|
end
|
99
113
|
end
|
100
114
|
end
|
@@ -7,19 +7,20 @@ module Ehbrs
|
|
7
7
|
module Unsupported
|
8
8
|
module Profiles
|
9
9
|
class Philco < ::Ehbrs::Videos::Unsupported::Profiles::Base
|
10
|
-
AUDIO_SUPPORTED_CODECS = %w[aac ac3 eac3 mp3].freeze
|
11
|
-
AUDIO_UNSUPPORTED_CODECS = %w[dts].freeze
|
10
|
+
AUDIO_SUPPORTED_CODECS = %w[aac ac3 eac3 mp3 vorbis wmav2].freeze
|
11
|
+
AUDIO_UNSUPPORTED_CODECS = %w[dts opus].freeze
|
12
12
|
|
13
13
|
VIDEO_SUPPORTED_CODECS = %w[h264 mpeg4].freeze
|
14
14
|
VIDEO_UNSUPPORTED_CODECS = %w[hevc msmpeg4v3].freeze
|
15
15
|
|
16
|
-
SUBTITLE_SUPPORTED_CODECS = %w[ass dvd
|
16
|
+
SUBTITLE_SUPPORTED_CODECS = %w[ass dvd dvd_subtitle hdmv_pgs_subtitle mov_text
|
17
|
+
subrip].freeze
|
17
18
|
SUBTITLE_UNSUPPORTED_CODECS = %w[mov].freeze
|
18
19
|
|
19
20
|
OTHER_SUPPORTED_CODECS = %w[png ttf].freeze
|
20
21
|
|
21
22
|
MPEG4_EXTRA_SUPPORTED = %w[xvid].freeze
|
22
|
-
MPEG4_EXTRA_UNSUPPORTED = %w[dx50].freeze
|
23
|
+
MPEG4_EXTRA_UNSUPPORTED = %w[divx dx50].freeze
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'aranha/parsers/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'aranha-parsers'
|
9
|
+
s.version = ::Aranha::Parsers::VERSION
|
10
|
+
s.authors = ['Esquilo Azul Company']
|
11
|
+
s.summary = 'Parsers\' utilities for Ruby.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*', 'Gemfile']
|
14
|
+
|
15
|
+
s.add_dependency 'activesupport', '>= 4.0.0'
|
16
|
+
s.add_dependency 'addressable', '~> 2.7'
|
17
|
+
s.add_dependency 'curb', '~> 0.9.10'
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.33', '>= 0.33.1'
|
19
|
+
s.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
|
20
|
+
s.add_dependency 'ofx-parser', '~> 1.1.0'
|
21
|
+
|
22
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1'
|
23
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'open-uri'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'aranha/parsers/source_address'
|
6
|
+
require 'eac_ruby_utils/fs/temp'
|
7
|
+
|
8
|
+
module Aranha
|
9
|
+
module Parsers
|
10
|
+
class Base
|
11
|
+
class << self
|
12
|
+
def from_content(content)
|
13
|
+
::EacRubyUtils::Fs::Temp.on_file do |path|
|
14
|
+
path.write(content)
|
15
|
+
r = new(path.to_path)
|
16
|
+
r.content
|
17
|
+
r
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def parse_content(content)
|
22
|
+
from_content(content).data
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
LOG_DIR_ENVVAR = 'ARANHA_PARSERS_LOG_DIR'
|
27
|
+
|
28
|
+
attr_reader :source_address
|
29
|
+
|
30
|
+
def initialize(url)
|
31
|
+
@source_address = ::Aranha::Parsers::SourceAddress.new(url)
|
32
|
+
log_content(source_address.serialize, '-source-address')
|
33
|
+
end
|
34
|
+
|
35
|
+
delegate :url, to: :source_address
|
36
|
+
|
37
|
+
def content
|
38
|
+
@content ||= begin
|
39
|
+
s = source_address.content
|
40
|
+
log_content(s)
|
41
|
+
s
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def log_content(content, suffix = '')
|
48
|
+
path = log_file(suffix)
|
49
|
+
|
50
|
+
return unless path
|
51
|
+
|
52
|
+
File.open(path, 'wb') { |file| file.write(content) }
|
53
|
+
end
|
54
|
+
|
55
|
+
def log_file(suffix)
|
56
|
+
dir = log_parsers_dir
|
57
|
+
return nil unless dir
|
58
|
+
|
59
|
+
f = ::File.join(dir, "#{self.class.name.parameterize}#{suffix}.log")
|
60
|
+
FileUtils.mkdir_p(File.dirname(f))
|
61
|
+
f
|
62
|
+
end
|
63
|
+
|
64
|
+
def log_parsers_dir
|
65
|
+
return ENV[LOG_DIR_ENVVAR] if ENV[LOG_DIR_ENVVAR]
|
66
|
+
return ::Rails.root.join('log', 'parsers') if rails_root_exist?
|
67
|
+
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
|
71
|
+
def rails_root_exist?
|
72
|
+
::Rails.root
|
73
|
+
true
|
74
|
+
rescue NameError
|
75
|
+
false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|