wayback_machine_downloader 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wayback_machine_downloader.rb +14 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5a9ed327cd0c9e564285e1a21989cf07bf2d402
|
4
|
+
data.tar.gz: 8149a9470eac26ee0f43aba2e175cffd0403af53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9992bad580b6fef2842dfb2f59ddab01f0e63c6b5290890eb20c4f9ac900ad3717d826b574aca51f1b096d4f55cbaf75eefa1239743b0b9654904350f492099e
|
7
|
+
data.tar.gz: 9471e4e0e307bd8e6829328249ec8544776755ddb9c663ac4557dc9377af06cbcbf80d7b8cd9dd2e1b824f0d1f0f006bc9921618a532c9617fcbf49b081257a5
|
@@ -4,7 +4,7 @@ require_relative 'wayback_machine_downloader/tidy_bytes'
|
|
4
4
|
|
5
5
|
class WaybackMachineDownloader
|
6
6
|
|
7
|
-
VERSION = "0.1.
|
7
|
+
VERSION = "0.1.13"
|
8
8
|
|
9
9
|
attr_accessor :base_url, :timestamp
|
10
10
|
|
@@ -80,17 +80,21 @@ class WaybackMachineDownloader
|
|
80
80
|
end
|
81
81
|
unless File.exists? file_path
|
82
82
|
structure_dir_path dir_path
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
begin
|
84
|
+
open(file_path, "wb") do |file|
|
85
|
+
begin
|
86
|
+
open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
|
87
|
+
file.write(uri.read)
|
88
|
+
end
|
89
|
+
rescue OpenURI::HTTPError => e
|
90
|
+
puts "#{file_url} # #{e}"
|
91
|
+
file.write(e.io.read)
|
92
|
+
rescue StandardError => e
|
93
|
+
puts "#{file_url} # #{e}"
|
87
94
|
end
|
88
|
-
rescue OpenURI::HTTPError => e
|
89
|
-
puts "#{file_url} # #{e}"
|
90
|
-
file.write(e.io.read)
|
91
|
-
rescue StandardError => e
|
92
|
-
puts "#{file_url} # #{e}"
|
93
95
|
end
|
96
|
+
rescue Errno::ENAMETOOLONG => e
|
97
|
+
puts "#{file_url} # #{e}"
|
94
98
|
end
|
95
99
|
puts "#{file_url} -> #{file_path} (#{count}/#{file_list_curated.size})"
|
96
100
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wayback_machine_downloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hartator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-rescue
|