|
|
|
@ -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
|
|
|
|
@ -55,3 +59,4 @@ namespace :video do
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|