蓝奏云 - 合并下载按钮

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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 })),
		},
	},
);