用 Go 编写的蓝奏云解析工具,提供 API 和终端支持

58 天前
 oyps

🍎 go-lanzou 🍑

🐱 项目地址https://github.com/iuroc/go-lanzou

⬇️ 可执行程序go-lanzou.exe [7.53MB]

已实现功能

作为模块

go get github.com/iuroc/go-lanzou
package main

import (
	"fmt"
	"github.com/iuroc/go-lanzou/lanzou"
)

func main() {
	shareURL := "https://www.lanzoui.com/imcSy2340ssb"
	downloadURL, err := lanzou.GetDownloadURL(shareURL)
	if err != nil {
		fmt.Println("解析失败")
	} else {
		fmt.Println("解析成功:" + downloadURL)
	}
}

API

// 获取文件夹最新的一个文件的信息,包含直链
//
// urlOrId 是文件夹的分享链接或 ID
//
// password 是访问密码
func lanzou.GetLatestFile(shareURL string, password string) (*lanzou.DownloadInfo, error)
// 获取单个文件的信息,包含直链
func lanzou.GetDownloadInfo(shareURL string, password string) (*lanzou.DownloadInfo, error)
// 获取文件夹中指定页码的文件列表
//
// page 的值务必从 0 开始,每次只允许增长 1 ,不可以直接从 0 变为 2 。
//
// 每次换页,务必暂停 1 秒以上。
func lanzou.GetFileList(shareURL string, password string, page int) ([]FileInfo, error)
1893 次点击
所在节点    程序员
3 条回复
adrianzhang
58 天前
点赞👍,有用!
molezznet
57 天前
厉害 收藏 待用
oiken
57 天前
点赞👍,有用!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1058820

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX