無法在 Dropbox 上下載檔案 400 錯誤要求

無法在 Dropbox 上下載檔案 400 錯誤要求

指導

https://tracker.ceph.com/projects/ceph/wiki/Ceph_Vagrant_Setup

$ wget https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box
--2020-03-14 12:11:09--  https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box
Resolving www.dropbox.com (www.dropbox.com)... 162.125.80.1
Connecting to www.dropbox.com (www.dropbox.com)|162.125.80.1|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: /s/raw/hn28qgjn59nud6h/ceph-all-in-one.box [following]
--2020-03-14 12:11:10--  https://www.dropbox.com/s/raw/hn28qgjn59nud6h/ceph-all-in-one.box
Reusing existing connection to www.dropbox.com:443.
HTTP request sent, awaiting response... 400 Bad Request
2020-03-14 12:11:10 ERROR 400: Bad Request.

文件已過期?

答案1

嘗試使用網頁瀏覽器存取https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box– Dropbox 顯示一則訊息:

404 我們找不到您要找的內容。

(雖然顯示訊息確實需要 javascript...)


透過以下方式請求頁面curl

$ curl -IL 'https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box'
HTTP/2 301
...
location: /s/raw/hn28qgjn59nud6h/ceph-all-in-one.box
...
HTTP/2 400

使用不同的User-Agent標題:

$ curl -A cruel -IL 'https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box'
HTTP/2 200
...
$ curl -s -A cruel 'https://www.dropbox.com/s/hn28qgjn59nud6h/ceph-all-in-one.box' |
> grep -om1 '<title>[^<]*'
<title>Dropbox - Error

相關內容