Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Set file id to nil when encounter UTF-8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hartator committed Sep 16, 2016
1 parent 94acdd6 commit bdf611b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ tmp

## RUBINIUS
*.rbc

test.rb
3 changes: 1 addition & 2 deletions lib/wayback_machine_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def get_file_list_curated
file_list_curated = Hash.new
[index_file_list_raw, all_file_list_raw].each do |file|
file.each_line do |line|
next if line.size < 20
file_timestamp = line[0..13].to_i
file_url = line[15..-2]
file_id = file_url.split('/')[3..-1].join('/')
file_id = file_url.split('/')[3..-1].join('/') rescue nil
file_id = CGI::unescape file_id
file_id = file_id.tidy_bytes unless file_id == ""
if file_id.nil?
Expand Down

0 comments on commit bdf611b

Please sign in to comment.