dev_video
cxt 5 years ago
parent 92795e0573
commit f1f0658e53

@ -45,7 +45,11 @@ namespace :video do
task :get_play_url => :environment do
Video.all.each do |video|
result = AliyunVod::Service.get_play_info(video.uuid)
if video.uuid.present?
end
result = AliyunVod::Service.get_play_info(video.uuid) rescue nil
if result.present? && result["PlayInfoList"]["PlayInfo"].present?
puts result
play_url = result["PlayInfoList"]["PlayInfo"].first["PlayURL"]
puts play_url
@ -54,4 +58,5 @@ namespace :video do
video.update!(play_url: play_url) if play_url.present?
end
end
end
end
Loading…
Cancel
Save