获取视频数据

dev_video
cxt 5 years ago
parent f075bb4ebb
commit 12ef158d5c

@ -1,16 +1,16 @@
namespace :video do
desc "get video play data"
task :data => :environment do
start_times = ['2019-08-19 00:00:00', '2019-11-10 00:00:00']
end_times = ['2019-11-06 23:59:59', '2019-02-06 23:59:59']
start_times = ['2019-08-19T00:00:00Z', '2019-11-10T00:00:00Z']
end_times = ['2019-11-06T23:59:59Z', '2019-02-06T23:59:59Z']
Video.all.each do |video|
vv = 0
play_duration = 0
start_times.each_with_index do |time, index|
start_time = time.to_time.getutc
end_time = end_times[index].to_time.getutc
start_time = time
end_time = end_times[index]
data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)

Loading…
Cancel
Save