手动获取有道云笔记的文件直链(PHP代码获取)

it2022-05-05  164

手动拼接

得到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;

最新回复(0)