image-dumper 0.5.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dumper +47 -40
- data/lib/dumper.rb +38 -36
- data/lib/dumper/dumper.rb +114 -52
- data/lib/dumper/profiles/4chan.rb +49 -33
- data/lib/dumper/profiles/behoimi.rb +48 -38
- data/lib/dumper/profiles/booru.rb +54 -40
- data/lib/dumper/profiles/deviantart.rb +49 -33
- data/lib/dumper/profiles/fakku.rb +61 -51
- data/lib/dumper/profiles/fc2.rb +49 -33
- data/lib/dumper/profiles/gelbooru.rb +54 -40
- data/lib/dumper/profiles/imagebam.rb +55 -37
- data/lib/dumper/profiles/mangaeden.rb +69 -53
- data/lib/dumper/profiles/mangago.rb +53 -40
- data/lib/dumper/profiles/mangahere.rb +68 -49
- data/lib/dumper/profiles/multiplayer.rb +55 -41
- data/lib/dumper/profiles/redblow.rb +49 -36
- data/lib/dumper/profiles/sankakucomplex.rb +81 -58
- data/lib/dumper/profiles/teca.rb +54 -34
- data/lib/dumper/profiles/yande.rb +51 -42
- data/lib/dumper/utils.rb +40 -42
- data/lib/dumper/version.rb +23 -23
- data/spec/4chan_spec.rb +28 -0
- data/spec/behoimi_spec.rb +28 -0
- data/spec/booru_spec.rb +28 -0
- data/spec/deviantart_spec.rb +28 -0
- data/spec/fakku_spec.rb +28 -0
- data/spec/fc2_spec.rb +28 -0
- data/spec/gelbooru_spec.rb +28 -0
- data/spec/imagebam_spec.rb +28 -0
- data/spec/mangaeden_spec.rb +28 -0
- data/spec/mangago_spec.rb +28 -0
- data/spec/mangahere_spec.rb +28 -0
- data/spec/multiplayer_spec.rb +28 -0
- data/spec/redblow_spec.rb +28 -0
- data/spec/sankakucomplex_spec.rb +41 -0
- data/spec/teca_spec.rb +28 -0
- data/spec/yande_spec.rb +28 -0
- metadata +119 -6
- data/lib/dumper/profiles/i_doujin.rb +0 -38
- data/lib/dumper/profiles/mi9.rb +0 -44
- data/lib/dumper/profiles/wallpaperhere.rb +0 -43
@@ -1,39 +1,49 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
-
#
|
4
|
-
# This file is part of Dumper.
|
5
|
-
#
|
6
|
-
# Dumper is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Dumper is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
module Dumper
|
21
|
-
module Profiles
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
class Behoimi < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from.upto(to) { |i|
|
26
|
+
Nokogiri::HTML(open("#{url}&page=#{i}", 'User-Agent' => Dumper::Profiles::USER_AGENT, 'Referer' => url)).xpath('//img[@class="preview "]/@src').each { |p|
|
27
|
+
@pool.process {
|
28
|
+
Dumper::Profiles.get path, p.to_s.gsub('preview/', ''), { referer: url }
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class << self
|
36
|
+
def get_behoimi(url, path, from = 1, to = 1)
|
37
|
+
Behoimi.new { |p|
|
38
|
+
p.dump url, path, from, to
|
39
|
+
p.shutdown
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def info_behoimi
|
44
|
+
{ from: :enabled, to: :enabled, type: :images }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
39
49
|
end
|
@@ -1,41 +1,55 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
-
#
|
4
|
-
# This file is part of Dumper.
|
5
|
-
#
|
6
|
-
# Dumper is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Dumper is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
module Dumper
|
21
|
-
module Profiles
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
class Booru < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
page = 0
|
26
|
+
|
27
|
+
from.upto(to) { |i|
|
28
|
+
puts "--- Page #{i} ---" if Dumper::Profiles.verbose?
|
29
|
+
|
30
|
+
Nokogiri::HTML(open("#{url}&pid=#{page}")).xpath('//span[@class="thumb"]').each { |u|
|
31
|
+
@pool.process {
|
32
|
+
Dumper::Profiles.get path, u.child.child['src'].gsub(/thumbs/, 'img').gsub(/thumbnails\//, 'images/').gsub(/thumbnail_/, '')
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
page += 40
|
37
|
+
}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class << self
|
42
|
+
def get_booru(url, path, from = 1, to = 1)
|
43
|
+
Booru.new { |p|
|
44
|
+
p.dump url, path, from, to
|
45
|
+
p.shutdown
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def info_booru
|
50
|
+
{ from: :enabled, to: :enabled, type: :pages }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
41
55
|
end
|
@@ -1,34 +1,50 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
-
#
|
4
|
-
# This file is part of Dumper.
|
5
|
-
#
|
6
|
-
# Dumper is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Dumper is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
module Dumper
|
21
|
-
module Profiles
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
class DeviantArt < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from -= 1
|
26
|
+
to -= 1 if to >= 1
|
27
|
+
|
28
|
+
Nokogiri::HTML(open(url)).xpath('//a[@class="thumb"]')[from..to].each { |u|
|
29
|
+
@pool.process {
|
30
|
+
Dumper::Profiles.get path, u['data-super-img']
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class << self
|
37
|
+
def get_deviantart(url, path, from = 1, to = -1)
|
38
|
+
DeviantArt.new { |p|
|
39
|
+
p.dump url, path, from, to
|
40
|
+
p.shutdown
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def info_deviantart
|
45
|
+
{ from: :enabled, to: :enabled, type: :images }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
34
50
|
end
|
@@ -1,52 +1,62 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
-
#
|
4
|
-
# This file is part of Dumper.
|
5
|
-
#
|
6
|
-
# Dumper is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Dumper is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
module Dumper
|
21
|
-
module Profiles
|
22
|
-
|
23
|
-
|
24
|
-
url
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
class Fakku < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
url += '/read' unless url.end_with? '/read'
|
26
|
+
errors = 0
|
27
|
+
|
28
|
+
cdn = open(url).read.split('window.params.thumbs')[1].split('\/thumbs\/')[0].gsub(/\\\//m, ?/)[5..-1] + '/images/'
|
29
|
+
|
30
|
+
from.upto(to) { |i|
|
31
|
+
return if errors == 10
|
32
|
+
|
33
|
+
file = "%03d.jpg" % i
|
34
|
+
filename = "#{cdn}#{file}"
|
35
|
+
|
36
|
+
@pool.process {
|
37
|
+
unless Dumper::Profiles.get path, URI.parse(URI.encode(filename, '[]')), { referer: url }
|
38
|
+
errors += 1
|
39
|
+
|
40
|
+
file = File.join(path, file).gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
|
41
|
+
File.delete(file) if File.exists? file
|
42
|
+
end
|
43
|
+
}
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class << self
|
49
|
+
def get_fakku(url, path, from = 1, to = 999)
|
50
|
+
Fakku.new { |p|
|
51
|
+
p.dump url, path, from, to
|
52
|
+
p.shutdown
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
def info_fakku
|
57
|
+
{ from: :enabled, to: :enabled, type: :images }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
52
62
|
end
|
data/lib/dumper/profiles/fc2.rb
CHANGED
@@ -1,34 +1,50 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
-
#
|
4
|
-
# This file is part of Dumper.
|
5
|
-
#
|
6
|
-
# Dumper is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU General Public License as published by
|
8
|
-
# the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Dumper is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public License
|
17
|
-
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
module Dumper
|
21
|
-
module Profiles
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
class Fc2 < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from -= 1
|
26
|
+
to -= 1 if to >= 1
|
27
|
+
|
28
|
+
Nokogiri::HTML(open(url)).xpath('//a[@target="_blank"]/@href')[from..to].each { |p|
|
29
|
+
@pool.process {
|
30
|
+
Dumper::Profiles.get(path, p) if p.to_s.end_with?('jpg') || p.to_s.end_with?('png')
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class << self
|
37
|
+
def get_fc2(url, path, from = 1, to = -1)
|
38
|
+
Fc2.new { |p|
|
39
|
+
p.dump url, path, from, to
|
40
|
+
p.shutdown
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def info_fc2
|
45
|
+
{ from: :enabled, to: :enabled, type: :images }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
34
50
|
end
|