Check if we have already downloaded a video

This commit is contained in:
George Kaklamanos 2018-04-29 19:44:18 +03:00
parent 2ce2868956
commit 06db124eac

View file

@ -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}",