我正在开发使用用户的Google帐户凭据将视频上传到YouTube的rails4应用程序。我成功联系了YoutubeDataApi来检查用户的凭据,但是当我尝试将视频推送到youtube服务器时,它会响应401错误:令牌无效。
Started POST "/videos/get_upload_token" for 127.0.0.1 at 2015-04-04 18:21:00 +0200
Processing by VideosController#get_upload_token as JSON
Parameters: {"utf8"=>"✓", "authenticity_token"=>"qisidAqdL5CjdfHbk20B6bS3DNYa1yjXn17Eos86TTVHAsP5j2WoR/FI08ptp04vGdWw3DLn/3HY6xt/Um2ztg==", "title"=>"sqdqs", "description"=>"dsqf"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
Rendered text template (0.0ms)
Completed 500 Internal Server Error in 210ms
OAuth2::Error (<HTML>
<HEAD>
<TITLE>Token invalid</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Token invalid</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
):
app/controllers/videos_controller.rb:24:in `get_upload_token'
我正在使用Youtube_it gem和oAuth2与谷歌联系。
以下是我项目的GitHub链接:https://github.com/GhostGumm/Bubblz101
非常感谢任何帮助或指示,谢谢:)。