jonnekaunisto / simple-youtube-api

Object-oriented Wrapper for Youtube API in Python
https://simple-youtube-api.rtfd.io
Other
74 stars 16 forks source link

Playlist upload error #23

Closed ettorecelozzi closed 4 years ago

ettorecelozzi commented 4 years ago

Hi, I used this library for a long time. Since today when I try to upload a video and put it in an existing paylist I receive a 400 error. Code below.

channel = Channel()
 channel.login("client_secret_smi.json", "credentials.storage")
 videoName = 'testVideo.mp4'
 video = LocalVideo(file_path=os.path.abspath('../' + folder + '/' + videoName))
 video.set_title('test')
 video.set_description("This is a description")
 video.set_category("education")
 video.set_embeddable(True)
 video.set_license("creativeCommon")
 video.set_privacy_status("unlisted")
 video.set_public_stats_viewable(True)
 video = channel.upload_video(video)
 channel.add_video_to_playlist(id, video)

And the error is: raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&alt=json returned "Invalid JSON payload received. Unknown name "playlistId" at 'resource.snippet': Proto field is not repeating, cannot start list.">

jonnekaunisto commented 4 years ago

I was able to run that code fine. The only things that were different were the videoName and the id of the playlist. Your id for the playlist is a string right?

ettorecelozzi commented 4 years ago

Today it works again. Nothig is changed. Thank you anyway.