|
|
|
@ -46,7 +46,9 @@ namespace :video do
|
|
|
|
|
task :get_play_url => :environment do
|
|
|
|
|
Video.all.each do |video|
|
|
|
|
|
result = AliyunVod::Service.get_play_info(video.uuid)
|
|
|
|
|
play_url = (result.dig('PlayInfoList', 'PlayInfo') || []).first&.[]('PlayURL')
|
|
|
|
|
puts result
|
|
|
|
|
play_url = data[:PlayInfoList][:PlayInfo][:PlayURL]
|
|
|
|
|
# play_url = (result.dig('PlayInfoList', 'PlayInfo') || []).first&.[]('PlayURL')
|
|
|
|
|
|
|
|
|
|
video.update!(play_url: play_url) if play_url.present?
|
|
|
|
|
end
|
|
|
|
|