#NEWLINE# def create_track( self , video_id , title , language , body , client_id , developer_key , auth_token = None , title_type = 'text' , **kwargs ) : #NEWLINE# #INDENT# 'Creates a closed-caption track and adds to an existing YouTube video.\n    ' #NEWLINE# new_entry = gdata . youtube . data . TrackEntry ( content = gdata . youtube . data . TrackContent ( text = body , lang = language ) ) #NEWLINE# uri = ( YOUTUBE_CAPTION_FEED_URI % video_id ) #NEWLINE# http_request = atom . http_core . HttpRequest ( uri = uri , method = 'POST' ) #NEWLINE# dev_key = ( 'key=' + developer_key ) #NEWLINE# authsub = ( ( 'AuthSub token="' + str ( auth_token ) ) + '"' ) #NEWLINE# http_request . headers = { #NEWLINE# #INDENT# 'Content-Type' : YOUTUBE_CAPTION_MIME_TYPE , #NEWLINE# 'Content-Language' : language , #NEWLINE# 'Slug' : title , #NEWLINE# 'Authorization' : authsub , #NEWLINE# 'GData-Version' : self . api_version , #NEWLINE# 'X-GData-Client' : client_id , #NEWLINE# 'X-GData-Key' : dev_key , #NEWLINE# #UNINDENT# } #NEWLINE# http_request . add_body_part ( body , http_request . headers [ 'Content-Type' ] ) #NEWLINE# return self . request ( http_request = http_request , desired_class = new_entry . __class__ , ** kwargs )