0.1.8 • Published 7 months ago

lanzou-api v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Lanzou API for Nodejs

用法

注意:当前的 API 实现并不完善,在之后的版本中用法会有破坏性变化

解析文件分享

import { loadShareUrl } from "lanzou-api";

const data = (await loadShareUrl("https://lanzoui.com/i8tbj0h")).unwrap();

if (data.type === "file") {
  console.log(data.downloadUrl);
}

解析带密码的文件夹分享

import { loadShareUrl } from "lanzou-api";

// 加载文件夹列表
const res = await loadShareUrl("https://yuandan.lanzouw.com/b02clwpxg","a765");
if (res.isErr()) {
  throw new Error(res.unwrapErr());
}
const data = res.unwrap();

if (data.type === "folder"){
  // 查找需要下载的文件
  const fileNode = data.nodes.find(n => n.name === "咬钩.txt");
  // 二次加载具体文件的分享链接
  if (fileNode?.shareUrl){
    const r = (await loadShareUrl(fileNode.shareUrl)).unwrap();
    if (r.type === "file") {
      console.log(r.downloadUrl);
    }
  }
}

测试链接

TODO

  • 支持嵌套文件夹分享(缺少带密码的嵌套文件夹分享示例)
  • 支持超长列表翻页
0.1.8

7 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago