lanzou

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 13 Imported by: 0

README

lanzou (Go)

Lanzou (蓝奏云) share-link resolver library and CLI.

Install

go install github.com/wantu/lanzou/cmd/lanzou@latest

Library

import "github.com/wantu/lanzou"

c := lanzou.New()
res, err := c.Parse(shareURL, lanzou.Options{
    Password: "5grc",       // optional
    ResolveDirect: true,
})

CLI

lanzou https://hya.lanzouu.com/iUTg43ww9ich
lanzou --pwd 5grc --down https://wwbss.lanzouu.com/ioHpR10k7d4b

License

MIT

Documentation

Overview

Package lanzou resolves Lanzou (蓝奏云) public and password share links.

Features:

  • public / password shares
  • Alibaba WAF/ESA acw_sc__v2 cookie
  • CDN pseudo-link resolution and risk-page fallback
  • optional local download

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasswordRequired = errors.New("password required for this share link")
)

Sentinel errors.

Functions

func CalcAcwScV2

func CalcAcwScV2(arg1 string) (string, error)

CalcAcwScV2 computes cookie value from arg1.

func CalcAcwScV2With

func CalcAcwScV2With(arg1, mask string, perm []int) (string, error)

CalcAcwScV2With allows custom mask/perm.

func ExtractArg1

func ExtractArg1(html string) (string, bool)

ExtractArg1 extracts arg1 from challenge HTML.

func IsAcwChallenge

func IsAcwChallenge(html string) bool

IsAcwChallenge reports whether HTML is an acw challenge page.

func IsPasswordProtected

func IsPasswordProtected(html string) bool

IsPasswordProtected detects password share HTML.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client holds HTTP state (cookies) for a lanzou session.

func New

func New() *Client

New creates a Client with browser-like headers and cookie jar map.

func (*Client) Download

func (c *Client) Download(rawURL, destDir, filename, referer string) (string, error)

Download saves url into destDir and returns the path.

func (*Client) Parse

func (c *Client) Parse(shareURL string, opt Options) (*Result, error)

Parse resolves a share URL.

func (*Client) ResolveDirectURL

func (c *Client) ResolveDirectURL(cdnURL string) (string, error)

ResolveDirectURL turns a CDN pseudo link into a downloadable URL.

type Options

type Options struct {
	Password      string
	ResolveDirect bool
}

Options for Parse.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns options with ResolveDirect enabled.

type Result

type Result struct {
	FID               string
	Filename          string
	PasswordProtected bool
	CDNDomain         string
	Telecom           string
	Unicom            string
	Normal            string
	Direct            string
	SavedPath         string
}

Result of a successful Parse.

Directories

Path Synopsis
cmd
lanzou command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL