code: def create_video(video_data):
      
  
      serializer = VideoSerializer(data=video_data)
      if serializer.is_valid():
          serializer.save()
          return video_data.get("edx_video_id")
      else:
          raise ValCannotCreateError(serializer.errors)
docs: Called on to create Video objects in the database
  
      create_video is used to create Video objects whose children are EncodedVideo
      objects which are linked to Profile objects. This is an alternative to the HTTP
      requests so it can be used internally. The VideoSerializer is used to
      deserialize this object. If there are duplicate profile_names, the entire
      creation will be rejected. If the profile is not found in the database, the
      video will not be created.
      Args:
          video_data (dict):
           {
                  url: api url to the video
                  edx_video_id: ID of the video
                  duration: Length of video in seconds
                  client_video_id: client ID of video
                  encoded_video: a list of EncodedVideo dicts
                      url: url of the video
                      file_size: size of the video in bytes
                      profile: ID of the profile
                  courses: Courses associated with this video
                  image: poster image file name for a particular course
           }
  
      Raises:
          Raises ValCannotCreateError if the video cannot be created.
  
      Returns the successfully created Video object