mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 17:56:44 +00:00
Add default encoding to UFT-8 for Ruby < 2 and Ruby
This commit is contained in:
parent
44924d0f5c
commit
ed7948a372
@ -1,3 +1,5 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
|
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require_relative 'wayback_machine_downloader/tidy_bytes'
|
require_relative 'wayback_machine_downloader/tidy_bytes'
|
||||||
@ -27,11 +29,6 @@ class WaybackMachineDownloader
|
|||||||
file_list_curated = Hash.new
|
file_list_curated = Hash.new
|
||||||
[index_file_list_raw, all_file_list_raw].each do |file|
|
[index_file_list_raw, all_file_list_raw].each do |file|
|
||||||
file.each_line do |line|
|
file.each_line do |line|
|
||||||
line = line.tidy_bytes
|
|
||||||
unless line
|
|
||||||
puts "Malformed line, ignoring."
|
|
||||||
next
|
|
||||||
end
|
|
||||||
line = line.split(' ')
|
line = line.split(' ')
|
||||||
file_timestamp = line[1].to_i
|
file_timestamp = line[1].to_i
|
||||||
file_url = line[2]
|
file_url = line[2]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user