def new_timelapse_project(name, internal, number_frames): """ Create a new project """ tp = TimelapseProject.objects.filter(name=name)[0] if tp: return tp else: project = TimelapseProject(name=name) project.save() print project return project
video.save() print set_remote_video_title(ACCESS_TOKEN, uri, project.name) def set_remote_video_title(access_token, video_uri, title): payload = {'name': title} video_full_url = "https://api.vimeo.com%s" % (video_uri) print "Set video title. Url is %s and payload is %s" % (video_full_url, payload) #print "Setting access_token %s in the Authorization header" % access_token auth_headers = {'Authorization': 'Bearer ' + access_token} print auth_headers return requests.patch("https://api.vimeo.com%s" % (video_uri), data=payload, headers=auth_headers) #def set_remote_video_title(access_token, video_uri, title, description, privacy): # payload = {'name': title, 'description': description, 'privacy.view': privacy} # video_full_url = "api.vimeo.com"; + video_uri # print "Set video title. Url is %s and payload is %s" % (video_full_url, payload) # #print "Setting access_token %s in the Authorization header" % access_token # auth_headers = {'Authorization': 'Bearer ' + access_token} # print auth_headers # return requests.patch("api.vimeo.com" + video_uri, data=payload, headers=auth_headers) project = TimelapseProject(name=PROJECT, interval=INTERVAL, number_frames=NUMBER_FRAMES) project.save() #project = TimelapseProject.objects.filter(name="testing")[0] #add_project_to_images(project) #capture_image(project) capture_timelapse(project) create_timelapse_video(project) push_to_vimeo(project)