image-dumper 0.5.5 → 0.6
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.
- 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,42 +1,56 @@
|
|
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
|
-
|
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 Multiplayer < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from -= 1
|
26
|
+
to -= 1 if to >= 1
|
27
|
+
|
28
|
+
url.gsub! /\/giochi\//, '/immagini/galleria/'
|
29
|
+
url.gsub! '.html', ''
|
30
|
+
gallery = JSON.parse open("#{url}?from=#{from}").read
|
31
|
+
|
32
|
+
to -= from if to >= 1
|
33
|
+
|
34
|
+
gallery['objects'].reverse[0..to].each { |image|
|
35
|
+
@pool.process {
|
36
|
+
Dumper::Profiles.get path, image['image']
|
37
|
+
}
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class << self
|
43
|
+
def get_multiplayer(url, path, from = 1, to = -1)
|
44
|
+
Multiplayer.new { |p|
|
45
|
+
p.dump url, path, from, to
|
46
|
+
p.shutdown
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def info_multiplayer
|
51
|
+
{ from: :enabled, to: :enabled, type: :images }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
42
56
|
end
|
@@ -1,37 +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
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
|
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 RedBlow < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from -= 1
|
26
|
+
to -= 1 if to >= 1
|
27
|
+
|
28
|
+
Nokogiri::HTML(open(url)).xpath('//img[@class="attachment-medium"]/@src')[from..to].each { |p|
|
29
|
+
@pool.process {
|
30
|
+
Dumper::Profiles.get path, p, { referer: url }
|
31
|
+
}
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class << self
|
37
|
+
def get_redblow(url, path, from = 1, to = -1)
|
38
|
+
RedBlow.new { |p|
|
39
|
+
p.dump url, path, from, to
|
40
|
+
p.shutdown
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def info_redblow
|
45
|
+
{ from: :enabled, to: :enabled, type: :images }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
37
50
|
end
|
@@ -1,59 +1,82 @@
|
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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 SankakuComplex < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
if url.include?('idol.sankakucomplex') || url.include?('chan.sankakucomplex')
|
26
|
+
to = 1 if to == -1
|
27
|
+
prefix = url.include?('idol.sankakucomplex') ? 'idol' : 'chan'
|
28
|
+
|
29
|
+
from.upto(to) { |page|
|
30
|
+
u = url + "&page=#{page}"
|
31
|
+
begin
|
32
|
+
op = open u
|
33
|
+
rescue Exception => e
|
34
|
+
sleep 1
|
35
|
+
retry
|
36
|
+
end
|
37
|
+
|
38
|
+
Nokogiri::HTML(op).xpath('//a/@href').each { |p|
|
39
|
+
next unless p.to_s.start_with? '/post/show'
|
40
|
+
|
41
|
+
@pool.process {
|
42
|
+
begin
|
43
|
+
img = Nokogiri::HTML(open("http://#{prefix}.sankakucomplex.com/#{p}")).at_xpath('//a[@itemprop="contentUrl"]/@href').to_s
|
44
|
+
Dumper::Profiles.get path, img, { referer: u }
|
45
|
+
rescue Exception => e
|
46
|
+
retry
|
47
|
+
end
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
else
|
52
|
+
from -= 1
|
53
|
+
to -= 1 if to >= 1
|
54
|
+
|
55
|
+
[].tap { |urls|
|
56
|
+
Nokogiri::HTML(open(url)).xpath('//a[@target="_blank"]/@href').each { |u|
|
57
|
+
urls << u if u.to_s.start_with? 'http://images.sankakucomplex.com/wp-content/'
|
58
|
+
}
|
59
|
+
}[from..to].each { |p|
|
60
|
+
@pool.process {
|
61
|
+
Dumper::Profiles.get path, p, { referer: url }
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class << self
|
69
|
+
def get_sankakucomplex(url, path, from = 1, to = -1)
|
70
|
+
SankakuComplex.new { |p|
|
71
|
+
p.dump url, path, from, to
|
72
|
+
p.shutdown
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
def info_sankakucomplex
|
77
|
+
{ from: :enabled, to: :enabled, type: :images }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
59
82
|
end
|
data/lib/dumper/profiles/teca.rb
CHANGED
@@ -1,35 +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
|
-
url
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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 Teca < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from -= 1
|
26
|
+
to -= 1 if to >= 1
|
27
|
+
url = url.split('index').first
|
28
|
+
|
29
|
+
[].tap { |urls|
|
30
|
+
Nokogiri::HTML(open(url)).xpath('//a/@href').each { |u|
|
31
|
+
urls << u if u.to_s =~ /.\.(png|bmp|jpeg|jpg|gif|tiff)$/i
|
32
|
+
}
|
33
|
+
}.reverse[from..to].each { |p|
|
34
|
+
@pool.process {
|
35
|
+
Dumper::Profiles.get path, "#{url}/#{p}"
|
36
|
+
}
|
37
|
+
}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class << self
|
42
|
+
def get_teca(url, path, from = 1, to = -1)
|
43
|
+
Teca.new { |p|
|
44
|
+
p.dump url, path, from, to
|
45
|
+
p.shutdown
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def info_teca
|
50
|
+
{ from: :enabled, to: :enabled, type: :images }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
35
55
|
end
|
@@ -1,43 +1,52 @@
|
|
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
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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 YandeRe < Profile
|
24
|
+
def dump(url, path, from, to)
|
25
|
+
from.upto(to) { |i|
|
26
|
+
puts "--- Page #{i} ---" if Dumper::Profiles.verbose?
|
27
|
+
|
28
|
+
Nokogiri::HTML(open("#{url}&page=#{i}", 'User-Agent' => Dumper::Profiles::USER_AGENT, 'Referer' => url)).xpath('//a[@class="thumb"]/@href').each { |p|
|
29
|
+
@pool.process {
|
30
|
+
img = Nokogiri::HTML(open("https://yande.re#{p}", 'User-Agent' => Dumper::Profiles::USER_AGENT, 'Referer' => url)).at_xpath('//img[@id="image"]/@src').text
|
31
|
+
Dumper::Profiles.get path, img, { referer: url }
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class << self
|
39
|
+
def get_yande(url, path, from = 1, to = 1)
|
40
|
+
YandeRe.new { |p|
|
41
|
+
p.dump url, path, from, to
|
42
|
+
p.shutdown
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def info_yande
|
47
|
+
{ from: :enabled, to: :enabled, type: :pages }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
43
52
|
end
|