Unable to delete videos to work using the Youtube data API. I am using the Python client library.
All this seems straight from the docs, so I'm very confused about why it doesn't work. Here is my function:
def delete_youtube_video_by_id(video_id): yt_service = gdata.youtube.service.YouTubeService() yt_service.email = YOUTUBE_EMAIL yt_service.password = YOUTUBE_SECRET_PASSWORD yt_service.source = YOUTUBE_SOURCE yt_service.developer_key = YOUTUBE_SECRET_DEVELOPER_KEY yt_service.client_id = YOUTUBE_CLIENT_ID yt_service.ProgrammaticLogin() video_entry = yt_service.GetYouTubeVideoEntry(video_id=video_id) response = yt_service.DeleteVideoEntry(video_entry) return response
In the docs, this should return True if the video was successfully deleted. However, it returns None:
>>> response = delete_youtube_video_by_id('my_youtube_video_id') >>> type(response) <type 'NoneType'> >>>
And the video is not deleted. I know that the credentials are good, because they are the same credentials that I, first of all, to download the video, and I know that the identifier is good, because I got it directly from my YouTube channel.
Any ideas?
source share