vixen_rename 0.1.0
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 +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +89 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/exe/vixen_rename +12 -0
- data/lib/vixen_rename/cli.rb +30 -0
- data/lib/vixen_rename/client.rb +49 -0
- data/lib/vixen_rename/file_parser.rb +66 -0
- data/lib/vixen_rename/net.rb +59 -0
- data/lib/vixen_rename/util.rb +32 -0
- data/lib/vixen_rename/version.rb +5 -0
- data/lib/vixen_rename.rb +35 -0
- metadata +162 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0dadad9ed8d1af50a6aa18ef38af070b2b72a9eb3380b32a7bcb97a8f1eb0c83
|
|
4
|
+
data.tar.gz: be61172541539cf55218b175c985b11619668fb1bcfdaef90cd90d234202b647
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 567bf4704726f323129139676cf407159172280f07fddf7cf37dc8e2cedb01c5c4cc19974f73347f5dbd420f59bb38fe2fb4984193eb7db384d758b63fdce944
|
|
7
|
+
data.tar.gz: d7aada12e84e04aad6e2ff6ccfa5b35a140d20f95913bcd1d90531f6600e6666f8deebd0d2a729be69862e34511e2ff972b5260a79bd3dba295c197161263a06
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
vixen_rename (0.1.0)
|
|
5
|
+
colorize (~> 0.8.1)
|
|
6
|
+
file_scan (~> 0.1.0)
|
|
7
|
+
httparty (~> 0.19.0)
|
|
8
|
+
rake (~> 13.0)
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
addressable (2.8.0)
|
|
14
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
15
|
+
ast (2.4.2)
|
|
16
|
+
coderay (1.1.3)
|
|
17
|
+
colorize (0.8.1)
|
|
18
|
+
crack (0.4.5)
|
|
19
|
+
rexml
|
|
20
|
+
diff-lcs (1.4.4)
|
|
21
|
+
file_scan (0.1.0)
|
|
22
|
+
colorize (~> 0.8.1)
|
|
23
|
+
rake (~> 13.0)
|
|
24
|
+
rubocop (~> 1.7)
|
|
25
|
+
hashdiff (1.0.1)
|
|
26
|
+
httparty (0.19.0)
|
|
27
|
+
mime-types (~> 3.0)
|
|
28
|
+
multi_xml (>= 0.5.2)
|
|
29
|
+
method_source (1.0.0)
|
|
30
|
+
mime-types (3.3.1)
|
|
31
|
+
mime-types-data (~> 3.2015)
|
|
32
|
+
mime-types-data (3.2021.0901)
|
|
33
|
+
multi_xml (0.6.0)
|
|
34
|
+
parallel (1.20.1)
|
|
35
|
+
parser (3.0.2.0)
|
|
36
|
+
ast (~> 2.4.1)
|
|
37
|
+
pry (0.14.1)
|
|
38
|
+
coderay (~> 1.1)
|
|
39
|
+
method_source (~> 1.0)
|
|
40
|
+
public_suffix (4.0.6)
|
|
41
|
+
rainbow (3.0.0)
|
|
42
|
+
rake (13.0.6)
|
|
43
|
+
regexp_parser (2.1.1)
|
|
44
|
+
rexml (3.2.5)
|
|
45
|
+
rspec (3.10.0)
|
|
46
|
+
rspec-core (~> 3.10.0)
|
|
47
|
+
rspec-expectations (~> 3.10.0)
|
|
48
|
+
rspec-mocks (~> 3.10.0)
|
|
49
|
+
rspec-core (3.10.1)
|
|
50
|
+
rspec-support (~> 3.10.0)
|
|
51
|
+
rspec-expectations (3.10.1)
|
|
52
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
53
|
+
rspec-support (~> 3.10.0)
|
|
54
|
+
rspec-mocks (3.10.2)
|
|
55
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
56
|
+
rspec-support (~> 3.10.0)
|
|
57
|
+
rspec-support (3.10.2)
|
|
58
|
+
rubocop (1.18.4)
|
|
59
|
+
parallel (~> 1.10)
|
|
60
|
+
parser (>= 3.0.0.0)
|
|
61
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
62
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
63
|
+
rexml
|
|
64
|
+
rubocop-ast (>= 1.8.0, < 2.0)
|
|
65
|
+
ruby-progressbar (~> 1.7)
|
|
66
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
67
|
+
rubocop-ast (1.9.0)
|
|
68
|
+
parser (>= 3.0.1.1)
|
|
69
|
+
ruby-progressbar (1.11.0)
|
|
70
|
+
thor (1.1.0)
|
|
71
|
+
unicode-display_width (2.0.0)
|
|
72
|
+
webmock (3.14.0)
|
|
73
|
+
addressable (>= 2.8.0)
|
|
74
|
+
crack (>= 0.3.2)
|
|
75
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
76
|
+
|
|
77
|
+
PLATFORMS
|
|
78
|
+
x86_64-darwin-20
|
|
79
|
+
|
|
80
|
+
DEPENDENCIES
|
|
81
|
+
pry (~> 0.14.1)
|
|
82
|
+
rspec (~> 3.10)
|
|
83
|
+
rubocop (~> 1.7)
|
|
84
|
+
thor (~> 1.1)
|
|
85
|
+
vixen_rename!
|
|
86
|
+
webmock (~> 3.14)
|
|
87
|
+
|
|
88
|
+
BUNDLED WITH
|
|
89
|
+
2.2.27
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 anujchandra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# VixenRename
|
|
2
|
+
|
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vixen_rename`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
+
|
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'vixen_rename'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle install
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install vixen_rename
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
TODO: Write usage instructions here
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
+
|
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vixen_rename.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "bundler/setup"
|
|
5
|
+
require "vixen_rename"
|
|
6
|
+
|
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
+
|
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
+
# require "pry"
|
|
12
|
+
# Pry.start
|
|
13
|
+
|
|
14
|
+
require "irb"
|
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/vixen_rename
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "thor"
|
|
4
|
+
|
|
5
|
+
module VixenRename
|
|
6
|
+
class Cli < Thor
|
|
7
|
+
def self.exit_on_failure?
|
|
8
|
+
true
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
desc "rename file_or_path", "Rename files in a directory"
|
|
12
|
+
long_desc <<-LONGDESC
|
|
13
|
+
`vixen_rename rename` will rename file(s) given to the cli
|
|
14
|
+
|
|
15
|
+
You can pass a single file or a directory containing files
|
|
16
|
+
|
|
17
|
+
By default the gem will not touch the files. The only way to
|
|
18
|
+
rename files is by passing a `--commit` flag.
|
|
19
|
+
|
|
20
|
+
> $ vixen_rename rename CHANNELS_102217_480P.mp4
|
|
21
|
+
> $ vixen_rename rename .
|
|
22
|
+
LONGDESC
|
|
23
|
+
option :commit, alias: :c, type: :boolean, default: false
|
|
24
|
+
|
|
25
|
+
def rename(location)
|
|
26
|
+
opts = options.transform_keys(&:to_sym)
|
|
27
|
+
Client.new(location, **opts).convert
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module VixenRename
|
|
4
|
+
# Top Level Client
|
|
5
|
+
class Client
|
|
6
|
+
include VixenRename::Util
|
|
7
|
+
|
|
8
|
+
def initialize(location, **opts)
|
|
9
|
+
@location = location
|
|
10
|
+
@net = Net.new
|
|
11
|
+
@verbose = opts[:commit] != true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def convert
|
|
15
|
+
convert_file if File.file? @location
|
|
16
|
+
|
|
17
|
+
convert_files_in_dir if File.directory? @location
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def convert_file
|
|
23
|
+
Dir.chdir(File.dirname(@location)) do
|
|
24
|
+
old_file_name = File.basename(@location)
|
|
25
|
+
new_filename, release_date = FileParser::Scene.new(@net).process(old_file_name)
|
|
26
|
+
return if new_filename.nil? || release_date.nil?
|
|
27
|
+
|
|
28
|
+
rename(old_file_name, new_filename, release_date, verbose: @verbose)
|
|
29
|
+
new_filename
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def convert_files_in_dir
|
|
34
|
+
scanner.each do |file|
|
|
35
|
+
new_filename, release_date = FileParser::Scene.new(@net).process(file)
|
|
36
|
+
next if new_filename.nil? || release_date.nil?
|
|
37
|
+
|
|
38
|
+
rename(file, new_filename, release_date, verbose: @verbose)
|
|
39
|
+
rescue VixenAPIError => e
|
|
40
|
+
print "Error: #{e}\n"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @return [FileScanner::Client]
|
|
45
|
+
def scanner
|
|
46
|
+
@scanner ||= FileScanner.new(@location, { nested: @verbose, extension: "*.mp4" })
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module VixenRename
|
|
4
|
+
module FileParser
|
|
5
|
+
|
|
6
|
+
# rubocop:disable Lint/MixedRegexpCaptureTypes
|
|
7
|
+
UNPROCESSED_SCENE_TYPE_1_REGEX = /
|
|
8
|
+
^ # Start of String
|
|
9
|
+
(?<site>(DEEPER|VIXEN|BLACKEDRAW|BLACKED|TUSHYRAW|TUSHY|CHANNELS)) # Site Name
|
|
10
|
+
_ # Separator
|
|
11
|
+
(?<video_id>\d*) # Video ID
|
|
12
|
+
_\d{3,4}P # Video Resolution
|
|
13
|
+
.mp4 # File Extension
|
|
14
|
+
$ # End of String
|
|
15
|
+
/x.freeze
|
|
16
|
+
|
|
17
|
+
UNPROCESSED_SCENE_TYPE_2_REGEX = /
|
|
18
|
+
^ # Start of String
|
|
19
|
+
(?<site>(DEEPER|VIXEN|BLACKEDRAW|BLACKED|TUSHYRAW|TUSHY|CHANNELS)) # Site Name
|
|
20
|
+
_ # Separator
|
|
21
|
+
(?<video_id>\d{6}) # Video ID
|
|
22
|
+
-.*_ # Actor First Name
|
|
23
|
+
\d{3,4}P # Resolution
|
|
24
|
+
.mp4 # File Extension
|
|
25
|
+
$ # End of String
|
|
26
|
+
/x.freeze
|
|
27
|
+
# rubocop:enable Lint/MixedRegexpCaptureTypes
|
|
28
|
+
|
|
29
|
+
# Class to fetch details for a scene using the filename
|
|
30
|
+
class Scene
|
|
31
|
+
|
|
32
|
+
# @param [VixenRename::Net] net
|
|
33
|
+
def initialize(net)
|
|
34
|
+
@net = net
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @param [String] file Name of file
|
|
38
|
+
def process(file)
|
|
39
|
+
@file = file
|
|
40
|
+
|
|
41
|
+
return if match.nil?
|
|
42
|
+
|
|
43
|
+
hash = search(match[:video_id], match[:site])
|
|
44
|
+
return filename(hash, File.extname(@file)), hash[:release_date]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def match
|
|
50
|
+
return @file.match(UNPROCESSED_SCENE_TYPE_1_REGEX) unless @file.match(UNPROCESSED_SCENE_TYPE_1_REGEX).nil?
|
|
51
|
+
|
|
52
|
+
@file.match(UNPROCESSED_SCENE_TYPE_2_REGEX) unless @file.match(UNPROCESSED_SCENE_TYPE_2_REGEX).nil?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def search(video_id, site)
|
|
56
|
+
@net.get_video_by_id(video_id, site)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def filename(hash, extension)
|
|
60
|
+
"#{hash[:models].join(", ")} [T] #{hash[:title].strip} [S] #{hash[:site].strip} [ID] #{hash[:video_id]}#{extension}"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'httparty'
|
|
4
|
+
|
|
5
|
+
module VixenRename
|
|
6
|
+
# Interact with a VixenGroup API
|
|
7
|
+
#
|
|
8
|
+
# Example:
|
|
9
|
+
# VixenRename::Net.new.get_video_by_id 100415, 'VIXEN'
|
|
10
|
+
class Net
|
|
11
|
+
include HTTParty
|
|
12
|
+
base_uri "https://www.vixen.com"
|
|
13
|
+
|
|
14
|
+
# @param [Integer] video_id
|
|
15
|
+
# @param [String] site
|
|
16
|
+
# @return [Hash]
|
|
17
|
+
def get_video_by_id(video_id, site)
|
|
18
|
+
@video_id = video_id
|
|
19
|
+
@site = site
|
|
20
|
+
resp = self.class.post("/graphql", body: body, headers: headers)
|
|
21
|
+
raise VixenAPIError, resp.code, resp.parsed_response, "HTTP Failed" if resp.code != 200
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
video_id: resp.dig("data", "findOneVideo", "videoId").to_i,
|
|
25
|
+
title: resp.dig("data", "findOneVideo", "title"),
|
|
26
|
+
release_date: Time.parse(resp.dig("data", "findOneVideo", "releaseDate")),
|
|
27
|
+
models: resp.dig("data", "findOneVideo", "modelsSlugged").map { |m| m["name"] },
|
|
28
|
+
site: site
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
|
|
34
|
+
# Generate the POST body
|
|
35
|
+
#
|
|
36
|
+
# @return [JSON]
|
|
37
|
+
def body
|
|
38
|
+
{
|
|
39
|
+
"operationName": "getVideo",
|
|
40
|
+
"variables": {
|
|
41
|
+
"videoId": @video_id,
|
|
42
|
+
"site": @site
|
|
43
|
+
},
|
|
44
|
+
"query": "query getVideo($videoId: ID, $site: Site) { findOneVideo(input: { videoId: $videoId, site: $site })" \
|
|
45
|
+
"{id: uuid videoId title releaseDate modelsSlugged: models{name}}}"
|
|
46
|
+
}.to_json
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @return [Hash{Symbol->String (frozen)}] headers
|
|
50
|
+
def headers
|
|
51
|
+
{
|
|
52
|
+
"content-type": "application/json"
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# VixenRename::Net.new.get_video_by_id 100415, 'VIXEN'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module VixenRename
|
|
4
|
+
module Util # :nodoc:
|
|
5
|
+
|
|
6
|
+
# rubocop:disable Metrics/MethodLength
|
|
7
|
+
# @param [String] old_name
|
|
8
|
+
# @param [String] new_name
|
|
9
|
+
# @param [Date] date
|
|
10
|
+
# @param [Boolean] verbose
|
|
11
|
+
def rename(old_name, new_name, date, verbose: true)
|
|
12
|
+
if verbose
|
|
13
|
+
print "File Match: #{old_name.to_s.colorize(:red)} " \
|
|
14
|
+
"can be renamed to #{new_name.to_s.colorize(:green)}\n"
|
|
15
|
+
else
|
|
16
|
+
begin
|
|
17
|
+
# Rename the file
|
|
18
|
+
File.rename(old_name, new_name)
|
|
19
|
+
|
|
20
|
+
# Update the modified time of the file to the date the scene was
|
|
21
|
+
# released and keep the accessed time as it is
|
|
22
|
+
File.utime(File.atime(new_name), date, new_name)
|
|
23
|
+
print "File Match: #{old_name.to_s.colorize(:red)} " \
|
|
24
|
+
"renamed to #{new_name.to_s.colorize(:green)}\n"
|
|
25
|
+
rescue Errno::ENAMETOOLONG
|
|
26
|
+
print "Generated name is too long. Skip processing.\n"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
# rubocop:enable Metrics/MethodLength
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/vixen_rename.rb
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "colorize"
|
|
4
|
+
require "file_scanner"
|
|
5
|
+
require "fileutils"
|
|
6
|
+
require "httparty"
|
|
7
|
+
require "json"
|
|
8
|
+
|
|
9
|
+
module VixenRename
|
|
10
|
+
class Error < StandardError; end
|
|
11
|
+
|
|
12
|
+
# Exception class when a Vixen API sends a non-200 response
|
|
13
|
+
class VixenAPIError < StandardError
|
|
14
|
+
# @param [Integer] code Response Code
|
|
15
|
+
# @param [Hash] body Response body
|
|
16
|
+
# @param [nil] msg Error Message
|
|
17
|
+
def initialize(code, body, msg = nil)
|
|
18
|
+
@code = code
|
|
19
|
+
@body = body
|
|
20
|
+
super(msg)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.new(location)
|
|
25
|
+
Client.new(location)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
require_relative "vixen_rename/file_parser"
|
|
30
|
+
require_relative "vixen_rename/net"
|
|
31
|
+
require_relative "vixen_rename/util"
|
|
32
|
+
require_relative "vixen_rename/version"
|
|
33
|
+
|
|
34
|
+
require_relative "vixen_rename/client"
|
|
35
|
+
require_relative "vixen_rename/cli"
|
metadata
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: vixen_rename
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- c477y
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: colorize
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.8.1
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.8.1
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: file_scan
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 0.1.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 0.1.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: httparty
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 0.19.0
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 0.19.0
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rake
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '13.0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '13.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rubocop
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '1.7'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '1.7'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rspec
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '3.10'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '3.10'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: pry
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.14.1
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 0.14.1
|
|
111
|
+
description: Library to rename files from Vixen, Blacked, BlackedRaw, Tushy, TushyRaw
|
|
112
|
+
and Deeper.
|
|
113
|
+
email:
|
|
114
|
+
- c477y@protonmail.com
|
|
115
|
+
executables:
|
|
116
|
+
- vixen_rename
|
|
117
|
+
extensions: []
|
|
118
|
+
extra_rdoc_files: []
|
|
119
|
+
files:
|
|
120
|
+
- ".rspec"
|
|
121
|
+
- ".rubocop.yml"
|
|
122
|
+
- Gemfile
|
|
123
|
+
- Gemfile.lock
|
|
124
|
+
- LICENSE.txt
|
|
125
|
+
- README.md
|
|
126
|
+
- Rakefile
|
|
127
|
+
- bin/console
|
|
128
|
+
- bin/setup
|
|
129
|
+
- exe/vixen_rename
|
|
130
|
+
- lib/vixen_rename.rb
|
|
131
|
+
- lib/vixen_rename/cli.rb
|
|
132
|
+
- lib/vixen_rename/client.rb
|
|
133
|
+
- lib/vixen_rename/file_parser.rb
|
|
134
|
+
- lib/vixen_rename/net.rb
|
|
135
|
+
- lib/vixen_rename/util.rb
|
|
136
|
+
- lib/vixen_rename/version.rb
|
|
137
|
+
homepage: https://github.com/c477y/vixen_rename
|
|
138
|
+
licenses:
|
|
139
|
+
- MIT
|
|
140
|
+
metadata:
|
|
141
|
+
homepage_uri: https://github.com/c477y/vixen_rename
|
|
142
|
+
source_code_uri: https://github.com/c477y/vixen_rename
|
|
143
|
+
post_install_message:
|
|
144
|
+
rdoc_options: []
|
|
145
|
+
require_paths:
|
|
146
|
+
- lib
|
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - ">="
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: 2.7.0
|
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - ">="
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0'
|
|
157
|
+
requirements: []
|
|
158
|
+
rubygems_version: 3.2.22
|
|
159
|
+
signing_key:
|
|
160
|
+
specification_version: 4
|
|
161
|
+
summary: CLI to rename videos downoaded from Vixen group
|
|
162
|
+
test_files: []
|