Check if we have already downloaded a video
This commit is contained in:
parent
2ce2868956
commit
06db124eac
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,9 @@ videos=DB[:videos]
|
|||
open(options[:feed]) do |rss|
|
||||
feed=RSS::Parser.parse(rss)
|
||||
feed.items.each do |item|
|
||||
if not DB[:videos].where(:url => "#{item.link}").count.eql? 0
|
||||
next
|
||||
end
|
||||
video=YoutubeDL.download "#{item.link}"
|
||||
videos.insert(:url => "#{item.link}",
|
||||
:filename => "#{video.filename}",
|
||||
|
|
Reference in a new issue