手動拼接
- 得到p參數:
http://note.youdao.com/yws/public/note/{分享id}?editorType=0&cstk=cGtjFpHb
- 拼接下載地址:
http://note.youdao.com/yws/api/personal/file/{p參數}?method=download&inline=true&shareKey={分享id}
PHP代碼
<?php
$id = $_GET['id'] ?? '';
if (empty($id)) {
exit('缺少有道雲分享id');
}
$url = "http://note.youdao.com/yws/public/note/{$id}?editorType=0&cstk=cGtjFpHb";
$res = file_get_contents($url);
$resArr = json_decode($res, true);
$p = trim($resArr['p'], '/');
$downUrl = "http://note.youdao.com/yws/api/personal/file/{$p}?method=download&inline=true&shareKey={$id}";
echo $downUrl;