蓝奏云 - 合并下载按钮

蓝奏云的“电信下载”、“联通下载”和“普通下载”其实是同一个超链接,不如把它们合并成一个下载按钮。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        蓝奏云 - 合并下载按钮
// @description 蓝奏云的“电信下载”、“联通下载”和“普通下载”其实是同一个超链接,不如把它们合并成一个下载按钮。
// @namespace   RainSlide
// @author      RainSlide
// @version     1.0
// @license     blessing
// @icon        https://lanzou.com/favicon.ico
// @inject-into page
// @run-at      document-start
// @grant       none
// @match       *://pan.lanzou.com/fn?*
// @match       *://*.lanzoub.com/fn?*
// @match       *://*.lanzoue.com/fn?*
// @match       *://*.lanzouf.com/fn?*
// @match       *://*.lanzouh.com/fn?*
// @match       *://*.lanzoui.com/fn?*
// @match       *://*.lanzouj.com/fn?*
// @match       *://*.lanzoul.com/fn?*
// @match       *://*.lanzoum.com/fn?*
// @match       *://*.lanzouo.com/fn?*
// @match       *://*.lanzoup.com/fn?*
// @match       *://*.lanzouq.com/fn?*
// @match       *://*.lanzout.com/fn?*
// @match       *://*.lanzouu.com/fn?*
// @match       *://*.lanzouv.com/fn?*
// @match       *://*.lanzouw.com/fn?*
// @match       *://*.lanzoux.com/fn?*
// @match       *://*.lanzouy.com/fn?*
// @match       *://*.lanzob.com/fn?*
// @match       *://*.lanzoe.com/fn?*
// @match       *://*.lanzof.com/fn?*
// @match       *://*.lanzoh.com/fn?*
// @match       *://*.lanzoi.com/fn?*
// @match       *://*.lanzoj.com/fn?*
// @match       *://*.lanzol.com/fn?*
// @match       *://*.lanzom.com/fn?*
// @match       *://*.lanzoo.com/fn?*
// @match       *://*.lanzop.com/fn?*
// @match       *://*.lanzoq.com/fn?*
// @match       *://*.lanzot.com/fn?*
// @match       *://*.lanzov.com/fn?*
// @match       *://*.lanzow.com/fn?*
// @match       *://*.lanzox.com/fn?*
// @match       *://*.lanzoy.com/fn?*
// ==/UserScript==

"use strict";

const success = data => {
	const go = document.getElementById("tourl");
	go.textContent = "";

	if (data.zt === 1) {
		go.appendChild(
			Object.assign(
				document.createElement("a"), {
					href: data.dom + "/file/" + data.url,
					rel: "noreferrer",
					className: "txt",
					style: "cursor: pointer",
					textContent: "下载",
				}
			)
		);
	} else {
		go.textContent = "网页超时,请刷新";
	}
};

Object.defineProperty(
	unsafeWindow, "$", {
		configurable: false,
		enumerable: true,
		writable: false,
		value: {
			ajax: settings => jQuery.ajax(Object.assign(settings, { success })),
		},
	},
);