image-dumper 0.5.3.4 → 0.5.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dumper/dumper.rb +1 -1
- data/lib/dumper/profiles/mangago.rb +41 -0
- data/lib/dumper/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9c0912ee6a14dbd1445a0c937adb1b34c65edfc
|
4
|
+
data.tar.gz: e8ee0556be46a4b9cc11fb690e66d0dbb4723437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99bb57c5fddaa65429f68c59927b5c39ffc262c50cfabe6282be66ad6e674fc29cc2cc98dd12fc96781d63897ec31e65ddf4cbb941a6d57c6bb845228d523b6e
|
7
|
+
data.tar.gz: cdbd2f4bd14b5a026815ceb86b3bb62be87912081bd7b86d691548da8f4e9415291bc6864bc4bd3113143c5a71829fe5fab6b7898e9f0b4f53cfd7317f2ee523
|
data/lib/dumper/dumper.rb
CHANGED
@@ -45,7 +45,7 @@ module Dumper; module Profiles
|
|
45
45
|
if File.exists? filename
|
46
46
|
puts "File #{filename} already exists."
|
47
47
|
else
|
48
|
-
filename = File.join path, rand(1000).to_s + '.jpg' unless filename[-4] == ?.
|
48
|
+
filename = File.join path, rand(1000).to_s + '.jpg' unless filename[-4] == ?. || filename[-5] == ?.
|
49
49
|
puts "Downloading #{p} as #{filename}..."
|
50
50
|
File.open(filename, 'wb') { |f| f.write open(p, 'User-Agent' => ua, 'Referer' => ref).read }
|
51
51
|
end
|
@@ -0,0 +1,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
|
+
def self.get_mangago(url, path, from = 1, to = 1)
|
24
|
+
n_pages = to > 1 ? to : Nokogiri::HTML(open(url)).at_xpath('//div[@class="page_select right"]/div[2]').text.scan(/\d+/).last.to_i
|
25
|
+
|
26
|
+
from.upto(n_pages) { |i|
|
27
|
+
page = Nokogiri::HTML(open(url))
|
28
|
+
|
29
|
+
url = page.at_xpath('//a[@id="pic_container"]/@href').to_s
|
30
|
+
scan = page.at_xpath('//img[@id="page1"]/@src').to_s[0..-3]
|
31
|
+
|
32
|
+
self.get path, scan, 'mozilla', url, "#{i}.#{scan.split(?.).last}"
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.info_mangago
|
37
|
+
{ :from => true, :to => true }
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
data/lib/dumper/version.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image-dumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.3.
|
4
|
+
version: 0.5.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: certified
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
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
40
|
version: '0'
|
41
41
|
description: A dumper to download whole galleries from board like 4chan, imagebam,
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/dumper/profiles/imagebam.rb
|
58
58
|
- lib/dumper/profiles/i_doujin.rb
|
59
59
|
- lib/dumper/profiles/mangaeden.rb
|
60
|
+
- lib/dumper/profiles/mangago.rb
|
60
61
|
- lib/dumper/profiles/mangahere.rb
|
61
62
|
- lib/dumper/profiles/mi9.rb
|
62
63
|
- lib/dumper/profiles/multiplayer.rb
|
@@ -78,12 +79,12 @@ require_paths:
|
|
78
79
|
- lib
|
79
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
81
|
requirements:
|
81
|
-
- -
|
82
|
+
- - '>='
|
82
83
|
- !ruby/object:Gem::Version
|
83
84
|
version: '0'
|
84
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
86
|
requirements:
|
86
|
-
- -
|
87
|
+
- - '>='
|
87
88
|
- !ruby/object:Gem::Version
|
88
89
|
version: '0'
|
89
90
|
requirements: []
|