From fc1783c5851909ef5cee4d7c04d40f1b08733a5a Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Wed, 15 Mar 2006 12:00:53 +0000 Subject: [PATCH] robuuster --- getdistorted/getdistorted.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/getdistorted/getdistorted.rb b/getdistorted/getdistorted.rb index c0abc73..14ffff0 100755 --- a/getdistorted/getdistorted.rb +++ b/getdistorted/getdistorted.rb @@ -83,12 +83,16 @@ def getenclosure(podcast, enclosure) @filelist[filename] = true if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}") puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}" - response = fetch(cast) - File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f| - f.print(response.body) - } - if @podcasts[podcast]["linkdir"] - File.symlink("#{@podcasts[podcast]["savedir"]}/#{filename}", "#{@podcasts[podcast]["linkdir"]}/#{filename}") + begin + response = fetch(cast) + File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f| + f.print(response.body) + } + if @podcasts[podcast]["linkdir"] + File.symlink("#{@podcasts[podcast]["savedir"]}/#{filename}", "#{@podcasts[podcast]["linkdir"]}/#{filename}") + end + rescue Timeout::Error, Errno::EHOSTUNREACH, Errno::ECONNREFUSED + puts " error fetching, skipping" end end end