robuuster
This commit is contained in:
parent
9c554638ff
commit
fc1783c585
1 changed files with 10 additions and 6 deletions
|
|
@ -83,6 +83,7 @@ def getenclosure(podcast, enclosure)
|
||||||
@filelist[filename] = true
|
@filelist[filename] = true
|
||||||
if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}")
|
if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}")
|
||||||
puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}"
|
puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}"
|
||||||
|
begin
|
||||||
response = fetch(cast)
|
response = fetch(cast)
|
||||||
File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f|
|
File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f|
|
||||||
f.print(response.body)
|
f.print(response.body)
|
||||||
|
|
@ -90,6 +91,9 @@ def getenclosure(podcast, enclosure)
|
||||||
if @podcasts[podcast]["linkdir"]
|
if @podcasts[podcast]["linkdir"]
|
||||||
File.symlink("#{@podcasts[podcast]["savedir"]}/#{filename}", "#{@podcasts[podcast]["linkdir"]}/#{filename}")
|
File.symlink("#{@podcasts[podcast]["savedir"]}/#{filename}", "#{@podcasts[podcast]["linkdir"]}/#{filename}")
|
||||||
end
|
end
|
||||||
|
rescue Timeout::Error, Errno::EHOSTUNREACH, Errno::ECONNREFUSED
|
||||||
|
puts " error fetching, skipping"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue