YouTube API3.0 videos.insert (upload) — “Failed to start the resumable upload” exception

前端 未结 1 2041
南旧
南旧 2021-01-24 18:03

I\'ve got code based on Google\'s YouTube Data API (v3.0) videos.insert example, which fails consistently for a particular user and authorization token with a Failed to st

相关标签:
1条回答
  • 2021-01-24 18:41

    Turns out it's possible for a user to give YouTube account permissions without actually having a YouTube account ;-)

    In Google_MediaFileUpload::getResumeUri, if a valid response isn't received, a Failed to start the resumable upload exception is thrown, and the response (containing the error reason) is thrown away.

    In this case, dumping the response showed the reason: youtubeSignupRequired.

    (For my local code, I'm saving the response so the caller can report why the upload failed)


    Update -- from YouTube Data API - Errors

    This error indicates that the user has an unlinked Google Account, which means that the user has a Google Account but does not have a YouTube channel. Such users can access many features that are dependent on user authorization, such as rating videos or adding videos to a watch_later playlist. However, as an example, the user would need a YouTube channel to be able to upload a video. A user who has a Gmail account or an Android device is certain to have a Google Account but may not have already linked that Google Account to a YouTube channel.

    0 讨论(0)
提交回复
热议问题