我一直在尝试使用Duck CLI将文件上传到64位Windows10的Dropbox。如果我提交如下请求:
call duck --assumeyes --username abcd --password 1234 --upload "dropbox:/Test Folder" "Test.txt"然后,它会提示我输入OAuth2令牌,并出现一个带有授权码的浏览器选项卡。我提供了这个,然后开始上传。一切都很好。我想绕过这一步,使用我生成的没有提示的代码。我试过了:
call duck --assumeyes --password <generated key> --upload "dropbox:/Test Folder" "Test.txt"但我仍然可以看到提示符和浏览器选项卡。我希望整个上传过程不会出现任何提示。我遗漏了什么?
有趣的是,这是按要求工作的(不会发出提示):
curl -X POST https://content.dropboxapi.com/2/files/upload ^
--header "Authorization: Bearer <generated key>" ^
--header "Dropbox-API-Arg: {\"path\": \"<DestinationFolder>\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" ^
--header "Content-Type: application/octet-stream" ^
--data-binary "@<filename>"但是上传速度只有1.4Mb/s左右,使用Duck是11Mb/s,所以速度快了8倍!
发布于 2019-11-11 17:39:27
请尝试使用您在谷歌注册的电子邮件地址作为username参数。这样,就可以在登录密钥链(macOS)或凭据管理器(Windows)中找到OAuth令牌。
https://stackoverflow.com/questions/58793562
复制相似问题