suby 0.4.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f0a1a763181e3fc745cb43434f3fce31fcb58dc4
4
+ data.tar.gz: 7412a82837266cd2fa71562f2f32828a846d31be
5
+ SHA512:
6
+ metadata.gz: 7f41ab44a95d593d248e24452bb990d9b0a1904cd2b103a211e8d1d80f5837a31ef8f6aae08c766dcd1826b9fcb4ad81a461013f15775197dea301ea985b7385
7
+ data.tar.gz: 9fcaade8a0d74d5514e08cbd3dcc22f78cbd585b86a227560c5457a51c859abece99fffb1fd5891ca40db1429c4eba25da6e22d636e69b9c5c3f8c9d21541449
@@ -36,12 +36,15 @@ module Suby
36
36
  end
37
37
 
38
38
  def xmlrpc
39
- @xmlrpc ||= XMLRPC::Client.new(self.class::SITE, self.class::XMLRPC_PATH).tap do |xmlrpc|
39
+ @xmlrpc ||= XMLRPC::Client.new(self.class::XMLRPC_HOST, self.class::XMLRPC_PATH).tap do |xmlrpc|
40
40
  xmlrpc.http_header_extra = { 'accept-encoding' => 'identity' } if RbConfig::CONFIG['MAJOR'] == '2'
41
41
  end
42
42
  end
43
43
 
44
44
  def get(path, initheader = {}, parse_response = true)
45
+ if host = URI.parse(path).host and host != self.class::SITE
46
+ raise DownloaderError, "Cross-Origin request not supported yet (#{host})"
47
+ end
45
48
  response = http.get(path, initheader)
46
49
  if parse_response
47
50
  unless Net::HTTPSuccess === response
@@ -78,7 +81,9 @@ module Suby
78
81
  def download
79
82
  begin
80
83
  extract download_url
81
- rescue Net::ReadTimeout => error
84
+ rescue Timeout::Error, Errno::ECONNREFUSED, Errno::EINVAL,
85
+ Errno::ECONNRESET, EOFError, RuntimeError, Net::HTTPBadResponse,
86
+ Net::HTTPHeaderSyntaxError, Net::ProtocolError => error
82
87
  raise Suby::DownloaderError, error.message
83
88
  end
84
89
  end
@@ -1,8 +1,9 @@
1
1
  module Suby
2
2
  # Based on https://github.com/byroot/ruby-osdb/blob/master/lib/osdb/server.rb
3
3
  class Downloader::OpenSubtitles < Downloader
4
- SITE = 'api.opensubtitles.org'
4
+ SITE = 'dl.opensubtitles.org'
5
5
  FORMAT = :gz
6
+ XMLRPC_HOST = 'api.opensubtitles.org'
6
7
  XMLRPC_PATH = '/xml-rpc'
7
8
  SUBTITLE_TYPES = [:tvshow, :movie, :unknown]
8
9
 
@@ -5,16 +5,17 @@ Gem::Specification.new do |s|
5
5
  s.author = 'eregon'
6
6
  s.email = 'eregontp@gmail.com'
7
7
  s.homepage = 'https://github.com/eregon/suby'
8
+ s.license = 'MIT'
8
9
 
9
10
  s.files = Dir['bin/*', 'lib/**/*.rb', '.gitignore', 'README.md', 'suby.gemspec']
10
11
  s.executables = ['suby']
11
12
 
12
13
  s.required_ruby_version = '>= 1.9.2'
13
- s.add_dependency 'path', '>= 1.3.0'
14
- s.add_dependency 'nokogiri'
15
- s.add_dependency 'rubyzip', '~> 1.1.0'
16
- s.add_dependency 'term-ansicolor'
17
- s.add_dependency 'mime-types', '>= 1.19'
14
+ s.add_dependency 'path', '~> 1.3'
15
+ s.add_dependency 'nokogiri', '~> 1.6'
16
+ s.add_dependency 'rubyzip', '~> 1.1'
17
+ s.add_dependency 'term-ansicolor', '~> 1.2'
18
+ s.add_dependency 'mime-types', '~> 1.19'
18
19
 
19
- s.version = '0.4.2'
20
+ s.version = '0.4.4'
20
21
  end
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
5
- prerelease:
4
+ version: 0.4.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - eregon
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-11-16 00:00:00.000000000 Z
11
+ date: 2014-05-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: path
16
- requirement: &2152578260 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 1.3.0
19
+ version: '1.3'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *2152578260
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: nokogiri
27
- requirement: &2152577700 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - ~>
31
32
  - !ruby/object:Gem::Version
32
- version: '0'
33
+ version: '1.6'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *2152577700
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rubyzip
38
- requirement: &2152576900 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ~>
42
46
  - !ruby/object:Gem::Version
43
- version: 1.1.0
47
+ version: '1.1'
44
48
  type: :runtime
45
49
  prerelease: false
46
- version_requirements: *2152576900
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: term-ansicolor
49
- requirement: &2152576280 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
- version: '0'
61
+ version: '1.2'
55
62
  type: :runtime
56
63
  prerelease: false
57
- version_requirements: *2152576280
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: mime-types
60
- requirement: &2152575740 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - ~>
64
74
  - !ruby/object:Gem::Version
65
75
  version: '1.19'
66
76
  type: :runtime
67
77
  prerelease: false
68
- version_requirements: *2152575740
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.19'
69
83
  description: Find and download subtitles
70
84
  email: eregontp@gmail.com
71
85
  executables:
@@ -86,27 +100,28 @@ files:
86
100
  - README.md
87
101
  - suby.gemspec
88
102
  homepage: https://github.com/eregon/suby
89
- licenses: []
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
90
106
  post_install_message:
91
107
  rdoc_options: []
92
108
  require_paths:
93
109
  - lib
94
110
  required_ruby_version: !ruby/object:Gem::Requirement
95
- none: false
96
111
  requirements:
97
- - - ! '>='
112
+ - - '>='
98
113
  - !ruby/object:Gem::Version
99
114
  version: 1.9.2
100
115
  required_rubygems_version: !ruby/object:Gem::Requirement
101
- none: false
102
116
  requirements:
103
- - - ! '>='
117
+ - - '>='
104
118
  - !ruby/object:Gem::Version
105
119
  version: '0'
106
120
  requirements: []
107
121
  rubyforge_project:
108
- rubygems_version: 1.8.11
122
+ rubygems_version: 2.0.3
109
123
  signing_key:
110
- specification_version: 3
124
+ specification_version: 4
111
125
  summary: Subtitles' downloader
112
126
  test_files: []
127
+ has_rdoc: