【问题标题】:Cyberduck CLI - How to prevent duck asking for authorization when uploading to dropboxCyber​​duck CLI - 如何防止鸭子在上传到保管箱时要求授权
【发布时间】:2019-11-10 22:37:48
【问题描述】:

我一直在尝试使用 Duck CLI 在 Windows 10 64 位中将文件上传到 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 时,速度为 11 Mb/s,因此快了八倍!

【问题讨论】:

    标签: file-upload command-line-interface dropbox-api cyberduck


    【解决方案1】:

    请尝试使用您在 Google 注册的电子邮件地址作为 username 参数。这样可以在登录钥匙串 (macOS) 或凭据管理器 (Windows) 中找到 OAuth 令牌。

    【讨论】:

    • 感谢您的回复。我会尝试一下,但它是否解释了为什么我能够让它与 curl 一起使用?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多