Greasy Fork 还支持 简体中文。

Discovery+ link extractor for Discovery Plus

Easily extract all links from Discovery+

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Discovery+ link extractor for Discovery Plus
// @version      1
// @description  Easily extract all links from Discovery+
// @author       pix
// @match        https://www.discoveryplus.com/*
// @icon         https://www.google.com/s2/favicons?domain=www.discoveryplus.com
// @grant        none
// @license      GPL3
// @namespace    dpluslinkextract
// ==/UserScript==

(function() {
    'use strict';

console.log(`%c Discovery+ Link Extractor \n [!] Run dplus.rip() to start [!] `, 'background: #FFF; color: #FF0006');
class ripcommand{
	rip(){
		var browser = prompt("what browser are you using? (none if you dont want a yt-dlp command)")
		console.log(`%c [!] Copy the command below. [!] `, 'background: #FFF; color: #FF0006');
		var alllinks = ``
		const regex = /https:\/\/www.discoveryplus.com\/video\/.*\/.*/g;
		var x = document.querySelectorAll("a");
		for (var i=0; i<x.length; i++){
			var nametext = x[i].textContent;
			var cleantext = nametext.replace(/\s+/g, ' ').trim();
			var cleanlink = x[i].href;
			cleanlink = [cleanlink].toString()
			if([cleantext] != `Resume`){
				if(cleanlink.match(regex)){
			  	if (browser == "" || browser == undefined || browser == null) {
			   		alllinks = alllinks + `${[cleanlink]}\n`
		    	}else{
			  		alllinks = alllinks + `yt-dlp --cookies-from-browser ${browser} "${[cleanlink]}" && `
		    	}
		    }
		  }
		}
		alllinks = alllinks.slice(0, -3)
		console.log(alllinks)
		console.log(`%c [!] Copy the command above. [!] `, 'background: #FFF; color: #FF0006');
	}
}
var dplus = new ripcommand()
window.dplus = new ripcommand()
})();