视频加载失败

蓝奏云直链解析工具

1704 字
9 分钟
蓝奏云直链解析工具
体验地址
xingmihai
/
Lanzou_straight_chain_analysis
蓝奏云直链解析
—
—
MIT
JavaScript

或最下面直接复制#

🌟 蓝奏云直链解析工具#

一个基于 Cloudflare Worker 的蓝奏云直链解析工具,可以一键获取蓝奏云分享链接的真实下载地址,跳过所有中间页面和广告。

✨ 功能特点#

  • 🚀 一键解析:自动解析蓝奏云分享链接
  • ⚡ 直接下载:重定向到真实文件下载地址
  • 🔍 调试模式:支持详细解析过程查看
  • 🌐 跨平台:在任何设备浏览器中均可使用
  • 🆓 完全免费:基于 Cloudflare Worker 免费额度
  • 🔒 隐私安全:不存储任何用户数据

🚀 快速开始#

基本用法#

  1. 获取蓝奏云分享链接 例如:https://hjgg.lanzoue.com/iN4ig37czcte

  2. 访问解析工具 https://你的worker.workers.dev/?url=你的蓝奏云链接

  3. 自动开始下载

  • 浏览器会自动重定向到真实下载地址

示例#

直接下载模式

https://你的worker.workers.dev/?url=https://wwi.lanzoup.com/i12345678

调试查看模式

https://你的worker.workers.dev/?url=https://wwi.lanzoup.com/i12345678&debug=1

🛠️ 部署到 Cloudflare Worker#

前置要求#

部署步骤#

  1. 注册 Cloudflare 账号

  2. 创建 Worker 服务

  3. 配置服务设置

    • 服务名称:lanzou-parser(或其他名称)
    • 选择免费计划
  4. 上传代码

    • 复制本项目的完整代码
    • 在 Worker 编辑器中粘贴代码
    • 点击 “Save and Deploy”
  5. 测试部署

    • 访问你的 Worker 地址进行测试
    • 格式:https://你的服务名称.你的账号子域.workers.dev

🔒 隐私与安全#

  • ❌ 不存储用户文件内容
  • ❌ 不记录下载历史
  • ❌ 不收集个人信息
  • ✅ 所有处理在内存中完成
  • ✅ HTTPS加密传输
  • ✅ Cloudflare安全防护

❓ 常见问题#

Q1: 为什么需要这个工具?#

A: 蓝奏云下载需要多次跳转和等待,这个工具可以跳过广告和等待时间,直接获取真实下载链接。

Q2: 是否支持所有蓝奏云链接?#

A: 支持大部分链接,但需要提取码的私密链接或已失效的链接可能无法解析。

Q3: 有没有使用限制?#

A: Cloudflare Worker免费版有每日10万次请求限制,个人使用完全足够。

Q4: 如何更新解析逻辑?#

A: 直接在Cloudflare Worker编辑器中更新代码并重新部署。

📞 技术支持#

如果遇到问题:

  1. 首先使用 &debug=1 参数查看详细错误信息
  2. 检查蓝奏云链接是否有效
  3. 在GitHub Issues中提交问题

📄 许可证#

本项目采用 MIT 许可证 - 详见 LICENSE 文件。

🤝 贡献#

欢迎提交 Issue 和 Pull Request!


⭐ 如果这个项目对你有帮助,请给个Star!

addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = new URL(request.url);
const targetUrl = url.searchParams.get("url");
const debug = url.searchParams.get("debug");
// 如果没有提供 URL 参数,返回使用说明
if (!targetUrl) {
return new Response(`
<!DOCTYPE html>
<html>
<head>
<title>蓝奏云直链下载工具</title>
<style>
body { font-family: Arial, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; }
.container { background: #f8f9fa; padding: 30px; border-radius: 10px; }
code { background: #eee; padding: 2px 5px; border-radius: 3px; }
.example { background: #e8f4f8; padding: 15px; border-left: 4px solid #007bff; }
.debug { background: #fff3cd; padding: 15px; border-left: 4px solid #ffc107; }
</style>
</head>
<body>
<div class="container">
<h1>🔗 蓝奏云直链下载工具</h1>
<p>使用方式:在URL后添加 <code>?url=你的蓝奏云链接</code></p>
<div class="example">
<strong>示例:</strong><br>
<code>https://你的worker.workers.dev/?url=https://wwi.lanzoup.com/xxxxxxxx</code>
</div>
<p>📝 功能:</p>
<ul>
<li>自动解析蓝奏云分享链接</li>
<li>直接重定向到文件下载</li>
</ul>
<div class="debug">
<p>🔍 <strong>调试模式</strong>:添加 <code>&debug=1</code> 参数查看解析过程</p>
<code>https://你的worker.workers.dev/?url=蓝奏云链接&debug=1</code>
</div>
</div>
</body>
</html>
`, {
headers: {
"Content-Type": "text/html; charset=utf-8"
}
});
}
try {
// 解析蓝奏云链接
const { finalUrl, logs } = await parseLanzouUrl(targetUrl);
// 调试模式:显示解析过程
if (debug) {
return new Response(`
<!DOCTYPE html>
<html>
<head>
<title>蓝奏云解析调试模式</title>
<style>
body { font-family: 'Courier New', monospace; background: #000; color: #00ff00; padding: 20px; }
.log-entry { margin: 10px 0; padding: 5px; border-left: 3px solid transparent; }
.info { border-left-color: #17a2b8; color: #17a2b8; }
.success { border-left-color: #28a745; color: #28a745; }
.warning { border-left-color: #ffc107; color: #ffc107; }
.error { border-left-color: #dc3545; color: #dc3545; }
.timestamp { color: #6c757d; font-size: 12px; margin-right: 10px; }
.result { background: #155724; padding: 15px; border-radius: 5px; margin: 20px 0; }
.final-url { color: #00ffff; word-break: break-all; }
.action-buttons { margin: 20px 0; }
button { background: #007bff; color: white; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; margin-right: 10px; }
button:hover { background: #0056b3; }
</style>
</head>
<body>
<h1>🔍 蓝奏云解析调试模式</h1>
<div id="logs">
${logs.map(log => `
<div class="log-entry ${log.type}">
<span class="timestamp">${log.time}</span> ${log.message}
</div>
`).join('')}
</div>
<div class="result">
<h3>✅ 解析成功!</h3>
<p><strong>最终直链:</strong></p>
<p class="final-url">${finalUrl}</p>
</div>
<div class="action-buttons">
<button onclick="window.open('${finalUrl}')">⬇️ 直接下载</button>
<button onclick="window.location.href='/?url=${encodeURIComponent(targetUrl)}'">🚀 直接访问(非调试模式)</button>
<button onclick="copyToClipboard('${finalUrl}')">📋 复制直链</button>
</div>
<script>
function copyToClipboard(text) {
navigator.clipboard.writeText(text).then(() => {
alert('已复制到剪贴板!');
});
}
</script>
</body>
</html>
`, {
headers: {
"Content-Type": "text/html; charset=utf-8"
}
});
}
// 正常模式:直接重定向到下载链接
return Response.redirect(finalUrl, 302);
} catch (error) {
// 返回错误页面
return new Response(`
<!DOCTYPE html>
<html>
<head>
<title>解析失败</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; }
.error { color: #dc3545; background: #f8d7da; padding: 20px; border-radius: 5px; }
.debug-link { color: #007bff; text-decoration: underline; cursor: pointer; }
</style>
</head>
<body>
<h1>❌ 解析失败</h1>
<div class="error">
<p><strong>错误信息:</strong> ${error.message}</p>
<p><strong>目标链接:</strong> ${targetUrl}</p>
</div>
<p>💡 请检查链接是否正确</p>
<p>
<a href="/">返回首页</a> |
<span class="debug-link" onclick="location.href=location.href + '&debug=1'">查看详细错误信息</span>
</p>
</body>
</html>
`, {
status: 500,
headers: {
"Content-Type": "text/html; charset=utf-8"
}
});
}
}
// 解析蓝奏云链接的核心函数
async function parseLanzouUrl(targetUrl) {
const logs = [];
function addLog(message, type = 'info') {
logs.push({
time: new Date().toLocaleTimeString(),
message,
type
});
}
addLog('开始解析蓝奏云链接', 'info');
addLog(`目标URL: ${targetUrl}`, 'info');
try {
// 1. 获取初始页面内容
addLog('步骤1: 获取初始页面', 'info');
const page1Response = await fetch(targetUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",
"Referer": "https://www.lanzou.com/"
}
});
if (!page1Response.ok) {
throw new Error(`初始页面请求失败: ${page1Response.status}`);
}
const page1Html = await page1Response.text();
addLog('初始页面获取成功', 'success');
// 提取下载链接
const downUrlMatch = page1Html.match(/<a href="([^"]+)"[^>]*id="downurl"/i);
if (!downUrlMatch) {
throw new Error("无法从页面提取下载链接");
}
const downUrl = "https://wwi.lanzoup.com" + downUrlMatch[1];
addLog(`提取到下载链接: ${downUrl}`, 'success');
// 2. 获取第二页内容
addLog('步骤2: 获取第二页内容', 'info');
const page2Response = await fetch(downUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36",
"Referer": targetUrl
}
});
if (!page2Response.ok) {
throw new Error(`第二页请求失败: ${page2Response.status}`);
}
const page2Html = await page2Response.text();
addLog('第二页获取成功', 'success');
// 提取变量
addLog('步骤3: 提取URL参数', 'info');
const part1Match = page2Html.match(/(?:var\s+)?vkjxld\s*=\s*['"]([^'"]+)/i);
const part2Match = page2Html.match(/(?:var\s+)?hyggid\s*=\s*['"]([^'"]+)/i);
if (!part1Match || !part2Match) {
throw new Error("无法提取URL参数");
}
const part1 = part1Match[1];
const part2 = part2Match[1];
addLog(`提取参数: vkjxld=${part1.substring(0, 20)}..., hyggid=${part2.substring(0, 20)}...`, 'success');
const finalUrl = part1 + part2;
addLog(`拼接最终URL: ${finalUrl}`, 'success');
addLog('✅ 解析完成!', 'success');
return { finalUrl, logs };
} catch (error) {
addLog(`解析失败: ${error.message}`, 'error');
throw error;
}
}

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!

打赏
蓝奏云直链解析工具
https://www.5al.top/posts/202509301932/
作者
星觅海
发布于
2025-09-30
许可协议
CC BY-NC-SA 4.0

评论区

Profile Image of the Author
星觅海
记录生活与技术的小站
公告
欢迎来到星觅海的小站,这里记录折腾与日常。
分类
标签
最新动态
站点统计
文章
7
分类
7
标签
9
总字数
5,136
运行时长
0 天
最后活动
0 天前
站点信息
构建平台
Cloudflare Pages
博客版本
Firefly v6.16.8
文章许可
CC BY-NC-SA 4.0
文章目录