24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/dumper/profiles/yande.rb', line 24
def dump(url, path, from, to)
from.upto(to) { |i|
notify_observers status: "--- Page #{i} ---"
Nokogiri::HTML(open("#{url}&page=#{i}", 'User-Agent' => Dumper::USER_AGENT, 'Referer' => url)).xpath('//a[@class="thumb"]/@href').each { |p|
@pool.process {
img = Nokogiri::HTML(open("https://yande.re#{p}", 'User-Agent' => Dumper::USER_AGENT, 'Referer' => url)).at_xpath('//img[@id="image"]/@src').text
Dumper.get path, img, { referer: url }
}
}
}
end
|