Add support for video posts
This commit is contained in:
parent
233ebb78d8
commit
b53ff71f97
|
@ -54,10 +54,11 @@ images.each_with_index do |r, i|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
jpg_path = "#{file_path}.jpg"
|
image_url = r['is_video'] ? r['video_url'] : r['responsive_url']
|
||||||
if options[:overwrite] or not File.exist? jpg_path
|
image_path = "#{file_path}#{File.extname image_url}"
|
||||||
open "https://#{r['responsive_url']}" do |f|
|
if options[:overwrite] or not File.exist? image_path
|
||||||
File.open jpg_path, 'wb' do |file|
|
open "https://#{image_url}" do |f|
|
||||||
|
File.open image_path, 'wb' do |file|
|
||||||
file.write f.read
|
file.write f.read
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue