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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6580398142a2bde95000f07ef0063927b969676
4
- data.tar.gz: 029c7e07d34b4c2b3b7d0c85c0567d495c6bd4ed
3
+ metadata.gz: f5a9ed327cd0c9e564285e1a21989cf07bf2d402
4
+ data.tar.gz: 8149a9470eac26ee0f43aba2e175cffd0403af53
5
5
  SHA512:
6
- metadata.gz: c1687ba78e8a13d0553dfbba528f36b5cfdfc089289450720ef10890f072b7d7bc31170810fde87825a4a9f0f9bcee0f6f3e5dbfd835f737c5b6edaecdfcf31d
7
- data.tar.gz: 8683d2a3cfdaae90039fdb117f0ed8776fcaad8ea919fed0ac2bbaae98ed6c42403f3488d73afa0e73b3285aa4b5628ba99a7d60a98979f5a2379207013f5ce9
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.12"
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
- open(file_path, "wb") do |file|
84
- begin
85
- open("http://web.archive.org/web/#{timestamp}id_/#{file_url}") do |uri|
86
- file.write(uri.read)
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.12
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-19 00:00:00.000000000 Z
11
+ date: 2015-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry-rescue