bathyscaphe 0.1.3 → 0.1.4
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.
- data/.gitignore +1 -0
- data/README.md +8 -8
- data/bin/bathyscaphe +2 -2
- data/lib/bathyscaphe/addic7ed.rb +2 -0
- data/lib/bathyscaphe/tvdb.rb +9 -1
- data/lib/bathyscaphe/version.rb +1 -1
- metadata +41 -50
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -29,12 +29,6 @@ or just
|
|
29
29
|
-d, --dry-run Parse filename but do not download anything
|
30
30
|
-h, --help Show usage
|
31
31
|
|
32
|
-
### TODO
|
33
|
-
|
34
|
-
1. Test regexp for matching more tv-show names
|
35
|
-
2. Write some tests
|
36
|
-
3. Maybe add other sources
|
37
|
-
|
38
32
|
### Changelog
|
39
33
|
|
40
34
|
#### 0.1.3
|
@@ -45,10 +39,16 @@ or just
|
|
45
39
|
- LICENCE defined
|
46
40
|
|
47
41
|
#### 0.1.1
|
48
|
-
Readme
|
42
|
+
- Readme changed =)
|
49
43
|
|
50
44
|
#### 0.1.0
|
51
|
-
Initial release
|
45
|
+
- Initial release
|
46
|
+
|
47
|
+
### TODO
|
48
|
+
|
49
|
+
1. Test regexp for matching more tv-show names
|
50
|
+
2. Write some tests
|
51
|
+
3. Maybe add other sources
|
52
52
|
|
53
53
|
### Authors
|
54
54
|
|
data/bin/bathyscaphe
CHANGED
@@ -14,9 +14,9 @@ file_dir = File.expand_path(File.dirname(file_arg))
|
|
14
14
|
|
15
15
|
|
16
16
|
begin
|
17
|
-
tv_show = Bathyscaphe::TVDB.new(file_name)
|
17
|
+
tv_show = Bathyscaphe::TVDB.new(file_name, file_dir)
|
18
18
|
rescue Exception => e
|
19
|
-
puts "\e[31m"+e+". Shame on us. \e[0m"
|
19
|
+
puts "\e[31m"+e.to_s+". Shame on us. \e[0m"
|
20
20
|
exit
|
21
21
|
end
|
22
22
|
|
data/lib/bathyscaphe/addic7ed.rb
CHANGED
@@ -122,9 +122,11 @@ module Bathyscaphe
|
|
122
122
|
rescue URI::InvalidURIError => e
|
123
123
|
STDERR.puts "\e[31m"+"We generated url the wrong way. Shame on us."+"\e[0m"
|
124
124
|
STDERR.puts e
|
125
|
+
STDERR.puts episode_link(:lang)
|
125
126
|
exit
|
126
127
|
rescue OpenURI::HTTPError => the_error
|
127
128
|
STDERR.puts "\e[31m"+"Server responded with funny status code #{the_error.io.status[0]}. Haven't seen it yet."+"\e[0m"
|
129
|
+
STDERR.puts episode_link(:lang)
|
128
130
|
exit
|
129
131
|
end
|
130
132
|
|
data/lib/bathyscaphe/tvdb.rb
CHANGED
@@ -6,13 +6,21 @@ module Bathyscaphe
|
|
6
6
|
|
7
7
|
attr_accessor :name, :season, :episode
|
8
8
|
|
9
|
-
def initialize filename
|
9
|
+
def initialize filename, filedir
|
10
10
|
if md = filename.match(TVREGEXP1) || md = filename.match(TVREGEXP2)
|
11
11
|
@name = md[1].gsub(".", " ").strip
|
12
12
|
@name = "Castle" if @name =~ /Castle 2009/i
|
13
13
|
@name = "Missing (2012)" if @name =~ /Missing 2012/i
|
14
14
|
@season = md[2].to_i.to_s
|
15
15
|
@episode = md[3].to_i.to_s
|
16
|
+
elsif md = filedir.split("/").last.match(/(.*)Season(.*)/i)
|
17
|
+
@name = md[1].gsub(/[-.]+/i, ' ').gsub("'", '').strip
|
18
|
+
@season = md[2].strip.scan(/^(\d+).*/).flatten.last.to_i.to_s
|
19
|
+
if namemd = filename.match(/(\d*).*/)
|
20
|
+
@episode = namemd[1].to_i.to_s
|
21
|
+
else
|
22
|
+
raise("Cant't parse filename")
|
23
|
+
end
|
16
24
|
else
|
17
25
|
raise("Cant't parse filename")
|
18
26
|
end
|
data/lib/bathyscaphe/version.rb
CHANGED
metadata
CHANGED
@@ -1,44 +1,41 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bathyscaphe
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 3
|
9
|
-
version: 0.1.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Ilia Zemskov
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-05-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: nokogiri
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Simple gem to download subtitles for tv-show episodes from addic7ed.com.
|
31
|
+
Subtitles are searched based on file name.
|
32
|
+
email:
|
34
33
|
- il.zoff@gmail.com
|
35
|
-
executables:
|
34
|
+
executables:
|
36
35
|
- bathyscaphe
|
37
36
|
extensions: []
|
38
|
-
|
39
37
|
extra_rdoc_files: []
|
40
|
-
|
41
|
-
files:
|
38
|
+
files:
|
42
39
|
- .gitignore
|
43
40
|
- Gemfile
|
44
41
|
- LICENSE
|
@@ -51,35 +48,29 @@ files:
|
|
51
48
|
- lib/bathyscaphe/config.rb
|
52
49
|
- lib/bathyscaphe/tvdb.rb
|
53
50
|
- lib/bathyscaphe/version.rb
|
54
|
-
has_rdoc: true
|
55
51
|
homepage: https://github.com/ilzoff/bathyscaphe
|
56
|
-
licenses:
|
52
|
+
licenses:
|
57
53
|
- MIT
|
58
54
|
post_install_message:
|
59
55
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
56
|
+
require_paths:
|
62
57
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
- 0
|
76
|
-
version: "0"
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
77
70
|
requirements: []
|
78
|
-
|
79
71
|
rubyforge_project: bathyscaphe
|
80
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.8.24
|
81
73
|
signing_key:
|
82
74
|
specification_version: 3
|
83
75
|
summary: Simple gem to download subtitles from addic7ed.com
|
84
76
|
test_files: []
|
85
|
-
|