meer opruimen
This commit is contained in:
parent
80f7c27c14
commit
5e553cdd9c
1 changed files with 21 additions and 17 deletions
|
|
@ -59,15 +59,9 @@ def deleteold(podcast)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
for podcast in @podcasts.keys.sort
|
def getenclosure(podcast, enclosure)
|
||||||
puts podcast
|
if ! enclosure.attribute("url").nil?
|
||||||
res = fetch(@podcasts[podcast]["rss"])
|
cast = enclosure.attribute("url").to_s.dup
|
||||||
@filelist = {}
|
|
||||||
|
|
||||||
xmldoc = REXML::Document.new(res.body)
|
|
||||||
xmldoc.elements.each("rss/channel/*/enclosure") {|x|
|
|
||||||
if ! x.attribute("url").nil?
|
|
||||||
cast = x.attribute("url").to_s.dup
|
|
||||||
filename = cast.dup
|
filename = cast.dup
|
||||||
filename.sub!(/^.*\//, "")
|
filename.sub!(/^.*\//, "")
|
||||||
if @podcasts[podcast]["rename"]
|
if @podcasts[podcast]["rename"]
|
||||||
|
|
@ -82,6 +76,16 @@ for podcast in @podcasts.keys.sort
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for podcast in @podcasts.keys.sort
|
||||||
|
puts podcast
|
||||||
|
res = fetch(@podcasts[podcast]["rss"])
|
||||||
|
@filelist = {}
|
||||||
|
|
||||||
|
xmldoc = REXML::Document.new(res.body)
|
||||||
|
xmldoc.elements.each("rss/channel/*/enclosure") {|enclosure|
|
||||||
|
getenclosure(podcast, enclosure)
|
||||||
}
|
}
|
||||||
if @podcasts[podcast]["delete"]
|
if @podcasts[podcast]["delete"]
|
||||||
deleteold(podcast)
|
deleteold(podcast)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue