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
|
||||
|
||||
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") {|x|
|
||||
if ! x.attribute("url").nil?
|
||||
cast = x.attribute("url").to_s.dup
|
||||
def getenclosure(podcast, enclosure)
|
||||
if ! enclosure.attribute("url").nil?
|
||||
cast = enclosure.attribute("url").to_s.dup
|
||||
filename = cast.dup
|
||||
filename.sub!(/^.*\//, "")
|
||||
if @podcasts[podcast]["rename"]
|
||||
|
|
@ -82,6 +76,16 @@ for podcast in @podcasts.keys.sort
|
|||
}
|
||||
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"]
|
||||
deleteold(podcast)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue