diff --git a/lib/tasks/get_video_data.rake b/lib/tasks/get_video_data.rake index 887f76220..49cafcc7b 100644 --- a/lib/tasks/get_video_data.rake +++ b/lib/tasks/get_video_data.rake @@ -1,16 +1,16 @@ namespace :video do desc "get video play data" task :data => :environment do - start_times = ['2019-08-19T00:00:00Z', '2019-11-10T00:00:00Z'] - end_times = ['2019-11-09T23:59:59Z', '2020-02-06T00:00:00Z'] + start_times = ['2019-08-19 00:00:00', '2019-11-10 00:00:00'] + end_times = ['2019-11-09 23:59:59', '2020-02-06 00:00:00'] Video.all.each do |video| vv = 0 play_duration = 0 start_times.each_with_index do |time, index| - start_time = time - end_time = end_times[index] + start_time = time.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') + end_time = end_times[index].to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)