you tube django libraries code example
Example: you tube django libraries
# Sample python code for videos.insert
def videos_insert(client, properties, media_file, **kwargs):
resource = build_resource(properties) # See full sample for function
kwargs = remove_empty_kwargs(**kwargs) # See full sample for function
request = client.videos().insert(
body=resource,
media_body=MediaFileUpload(media_file, chunksize=-1,
resumable=True),
**kwargs
)
# See full sample for function
return resumable_upload(request, 'video', 'insert')
media_file = 'sample_video.flv'
if not os.path.exists(media_file):
exit('Please specify a valid file location.')
videos_insert(client,
{'snippet.categoryId': '22',
'snippet.defaultLanguage': '',
'snippet.description': 'Description of uploaded video.',
'snippet.tags[]': '',
'snippet.title': 'Test video upload',
'status.embeddable': '',
'status.license': '',
'status.privacyStatus': 'private',
'status.publicStatsViewable': ''},
media_file,
part='snippet,status')