diff --git a/getazure.rb b/getazure.rb index 6a79664..ef02d55 100644 --- a/getazure.rb +++ b/getazure.rb @@ -14,7 +14,9 @@ podcasts.each do |podcast| source = podcast.at('enclosure')['url'].to_s name = source.split('/').last local_file = "downloads/#{name}" + next if File.exist? local_file + File.open(local_file, "wb") do |file| puts " downloading " + name file.write open(source).read