Skip to content

Go 语言实现的蓝奏云直链解析程序。

License

Notifications You must be signed in to change notification settings

iuroc/go-lanzou

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-lanzou

Go 语言实现的蓝奏云直链解析程序。

已实现功能

  • 获取单个文件(可带密码)的直链
  • 获取文件夹(可带密码)内最新一个文件的直链
  • 获取文件夹(可带密码)内任意页码的文件列表

快速开始

# 运行项目
go run .

# 生成可执行文件
go build

🍎 你也可以下载可执行文件进行使用。

作为模块

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)

蓝奏云分享合集

蓝奏云分享合集