image-dumper 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dumper.rb +3 -3
- data/lib/dumper/profiles/mangaeden.rb +5 -9
- data/lib/dumper/profiles/mangahere.rb +3 -9
- data/lib/dumper/version.rb +1 -1
- data/spec/imagebam_spec.rb +3 -3
- data/spec/mangaeden_spec.rb +2 -2
- data/spec/mangahere_spec.rb +2 -2
- data/spec/multiplayer_spec.rb +1 -1
- data/spec/sankakucomplex_spec.rb +1 -1
- 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: b87f39b372cb14a7ef17e6e5da413b6337e7c5b0
|
4
|
+
data.tar.gz: 29f982e0c28c2dd7448c17eff1a92d8f8190df1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d65683e728928a776b7333067a39ed1d8eb8da9b78ac956ee9874d68c68f4e5d7423e5f3f3fa55248b128fa81124bcb35d8231082774e3b26988db998143526
|
7
|
+
data.tar.gz: fb762aa7438ac757a50faaae629ec068dbbf6a1f5bc812d6ab78bf69eb6425194360fc464c2cd4d3d49e26df31c9706067408b8804304fb9e9e12ee09da81e30
|
data/lib/dumper.rb
CHANGED
@@ -3,18 +3,18 @@
|
|
3
3
|
#
|
4
4
|
# This file is part of Dumper.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU General Public License as published by
|
8
8
|
# the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#++
|
19
19
|
|
20
20
|
require 'open-uri'
|
@@ -33,19 +33,15 @@ module Dumper
|
|
33
33
|
|
34
34
|
page = Nokogiri::HTML open("http://www.mangaeden.com#{p['href']}")
|
35
35
|
|
36
|
-
page.
|
37
|
-
|
38
|
-
i += 1
|
39
|
-
}
|
36
|
+
Dumper::Profiles.get dir, page.at_xpath('//img[@id="mainImg"]/@src'), { filename: '1.png' }
|
37
|
+
i += 1
|
40
38
|
|
41
39
|
page.xpath('//a[@class="ui-state-default"]').each { |q|
|
42
|
-
next unless q.text.numeric?
|
43
|
-
q = q['href']
|
40
|
+
next unless q.text.numeric?
|
44
41
|
|
45
|
-
Nokogiri::HTML(open("http://www.mangaeden.com#{q}")).xpath('//img[@id="mainImg"]/@src').each { |r|
|
42
|
+
Nokogiri::HTML(open("http://www.mangaeden.com#{q['href']}")).xpath('//img[@id="mainImg"]/@src').each { |r|
|
46
43
|
@pool.process {
|
47
|
-
Dumper::Profiles.get dir, r, { filename: "#{
|
48
|
-
i += 1
|
44
|
+
Dumper::Profiles.get dir, r, { filename: "#{q.text.to_i}.png" }
|
49
45
|
}
|
50
46
|
}
|
51
47
|
}
|
@@ -36,16 +36,10 @@ module Dumper
|
|
36
36
|
dir = File.join path, name.sanitize_filename
|
37
37
|
Dir.mkdir(dir) unless File.directory? dir
|
38
38
|
|
39
|
-
|
40
|
-
first = option.first.text.to_i
|
41
|
-
last = option.last.text.to_i
|
42
|
-
|
43
|
-
first.upto(last) { |i|
|
39
|
+
Nokogiri::HTML(open(chapter)).xpath('//select[@class="wid60"]/option').each { |q|
|
44
40
|
@pool.process {
|
45
|
-
|
46
|
-
|
47
|
-
scan = Nokogiri::HTML(open(url)).xpath('//section[@id="viewer"]/a/img/@src')[0].to_s
|
48
|
-
Dumper::Profiles.get dir, scan, { filename: "#{i}.png" }
|
41
|
+
scan = Nokogiri::HTML(open(q['value'])).xpath('//section[@id="viewer"]/a/img/@src')[0].to_s
|
42
|
+
Dumper::Profiles.get dir, scan, { filename: "#{q.text}.png" }
|
49
43
|
}
|
50
44
|
}
|
51
45
|
}
|
data/lib/dumper/version.rb
CHANGED
data/spec/imagebam_spec.rb
CHANGED
@@ -14,15 +14,15 @@ describe 'Dumper' do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'dumps a gallery from imagebam' do
|
17
|
-
url = 'http://www.imagebam.com/gallery/
|
17
|
+
url = 'http://www.imagebam.com/gallery/sb7rsktifbm6h2lpz6einoq6mou3j57k/'
|
18
18
|
Dumper::Profiles.get_imagebam url, @dir
|
19
19
|
|
20
20
|
images = Dir["#{@dir}/*"]
|
21
|
-
expect(images.length).to be
|
21
|
+
expect(images.length).to be 67
|
22
22
|
|
23
23
|
image = FastImage.size images.last
|
24
24
|
expect(image).to be_kind_of(Array)
|
25
25
|
|
26
|
-
expect(image.first).to be
|
26
|
+
expect(image.first).to be >= 500
|
27
27
|
end
|
28
28
|
end
|
data/spec/mangaeden_spec.rb
CHANGED
@@ -18,11 +18,11 @@ describe 'Dumper' do
|
|
18
18
|
Dumper::Profiles.get_mangaeden url, @dir, 1, 2
|
19
19
|
|
20
20
|
images = Dir["#{@dir}/*_Question/*"]
|
21
|
-
expect(images.length).to be
|
21
|
+
expect(images.length).to be 27
|
22
22
|
|
23
23
|
image = FastImage.size images.first
|
24
24
|
expect(image).to be_kind_of(Array)
|
25
25
|
|
26
|
-
expect(image.first).to be
|
26
|
+
expect(image.first).to be > 500
|
27
27
|
end
|
28
28
|
end
|
data/spec/mangahere_spec.rb
CHANGED
@@ -20,9 +20,9 @@ describe 'Dumper' do
|
|
20
20
|
images = Dir["#{@dir}/*_2/*"]
|
21
21
|
expect(images.length).to be 41
|
22
22
|
|
23
|
-
image = FastImage.size images.
|
23
|
+
image = FastImage.size images.first
|
24
24
|
expect(image).to be_kind_of(Array)
|
25
25
|
|
26
|
-
expect(image.first).to be
|
26
|
+
expect(image.first).to be >= 453
|
27
27
|
end
|
28
28
|
end
|
data/spec/multiplayer_spec.rb
CHANGED
data/spec/sankakucomplex_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image-dumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -181,7 +181,7 @@ files:
|
|
181
181
|
- spec/teca_spec.rb
|
182
182
|
- spec/yande_spec.rb
|
183
183
|
- bin/dumper
|
184
|
-
homepage:
|
184
|
+
homepage: https://github.com/RoxasShadow
|
185
185
|
licenses:
|
186
186
|
- GPL-3
|
187
187
|
metadata: {}
|