suby 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/suby/downloader/addic7ed.rb +2 -1
- data/lib/suby/downloader/opensubtitles.rb +11 -6
- data/suby.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea64dff7ca20833220712ab314cac127bfa30585
|
4
|
+
data.tar.gz: 0b151066baa804a8530e5def830e45300716d2d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3813065dedd61305cd15d0df468177c392de5d638b3bb8597fe69910112a9edb58e4066f871e7f3cad775791b11a660e1c148a5b3d0c5b02928ccb259dcac52
|
7
|
+
data.tar.gz: 1fa64946d1d8be0ba23eb056370c36f8c336ca548a64961df835a8d4923fb2f2fcedd6aa685444cae5b56fad8c8d5bd9098b3be5bf7678e6915bc62212f97a9a
|
data/README.md
CHANGED
@@ -15,7 +15,8 @@ module Suby
|
|
15
15
|
"Filter ignored"
|
16
16
|
|
17
17
|
def subtitles_url
|
18
|
-
|
18
|
+
encoded_show = CGI.escape show.tr(' ','_')
|
19
|
+
"/serie/#{encoded_show}/#{season}/#{episode}/#{LANG_IDS[lang]}"
|
19
20
|
end
|
20
21
|
|
21
22
|
def subtitles_response
|
@@ -1,7 +1,7 @@
|
|
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 = 'dl.opensubtitles.
|
4
|
+
SITE = 'dl.opensubtitles.org'
|
5
5
|
FORMAT = :gz
|
6
6
|
XMLRPC_HOST = 'api.opensubtitles.org'
|
7
7
|
XMLRPC_PATH = '/xml-rpc'
|
@@ -30,17 +30,22 @@ module Suby
|
|
30
30
|
|
31
31
|
def download_url
|
32
32
|
SEARCH_QUERIES_ORDER.find(lambda { raise NotFoundError, "no subtitles available" }) { |type|
|
33
|
-
|
33
|
+
subs = search_subtitles(search_query(type))
|
34
|
+
if subs && !subs.empty?
|
34
35
|
@type = type
|
35
36
|
break subs
|
36
37
|
end
|
37
|
-
}.
|
38
|
+
}.sample['SubDownloadLink']
|
38
39
|
end
|
39
40
|
|
40
41
|
def search_subtitles(query)
|
41
|
-
return
|
42
|
-
|
43
|
-
|
42
|
+
return [] unless query
|
43
|
+
response = xmlrpc.call('SearchSubtitles', token, [query])
|
44
|
+
data = response["data"]
|
45
|
+
return [] unless data
|
46
|
+
data.select { |sub|
|
47
|
+
sub["SubDownloadLink"] and sub["SubLanguageID"] == query[:sublanguageid]
|
48
|
+
}
|
44
49
|
end
|
45
50
|
|
46
51
|
def token
|
data/suby.gemspec
CHANGED
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.required_ruby_version = '>= 1.9.2'
|
14
14
|
s.add_dependency 'path', '~> 1.3'
|
15
|
-
s.add_dependency 'nokogiri', '~> 1.6'
|
15
|
+
s.add_dependency 'nokogiri', '~> 1.6.7'
|
16
16
|
s.add_dependency 'rubyzip', '~> 1.1'
|
17
17
|
s.add_dependency 'term-ansicolor', '~> 1.2'
|
18
18
|
s.add_dependency 'mime-types', '~> 1.19'
|
19
19
|
|
20
|
-
s.version = '0.4.
|
20
|
+
s.version = '0.4.6'
|
21
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eregon
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.6.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.6.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubyzip
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|