Nexus No Wait

Download from Nexusmods.com without wait and redirect (support Manual/Vortex)

2019-12-29 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        Nexus No Wait
// @description Download from Nexusmods.com without wait and redirect (support Manual/Vortex)
// @namespace   NexusNoWait
// @include     https://www.nexusmods.com/*/mods/*
// @run-at      document-idle
// @version     1.2
// @require			http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==


$(document).on( 'click', '.btn', function(event) {
  
	var href = $(this).attr('href');
  	if (~href.indexOf("file_id")){
		event.preventDefault();
		var button = $(this);
      
		button.css("color", "yellow");
		button.text('WAIT');
      
		$.ajax({
		type: "GET",
		url: href,
		success: function (data) {
			if (!~href.indexOf("nmm")){
			  var section = $(data).filter('#section');
			  var search_params = new URLSearchParams(href);
			  
			  var file_id = search_params.get("file_id");
			  var game_id = section.data("gameId");
			  
			  $.ajax(
				{
				  type: "POST",
				  url: "/Core/Libs/Common/Managers/Downloads?ConfirmFinishedDownload",
				  xhrFields: { withCredentials: true },
				  data: {
					fid: file_id,
					game_id: game_id
				  }
				});		
			}		
			var slow = $(data).find('#slowDownloadButton');
			var downloadUrl = slow.data('download-url');
			document.location.href = downloadUrl;
			button.css("color", "green");
			button.text('LOADING');
			},
			error: function (ajaxContext) {
				console.log(ajaxContext.responseText);
				button.css("color", "red");
				button.text('ERROR');
			}
		});
    }
	var popup = $(this).parent();
	if (popup.hasClass('popup')){
		popup.children("button").click();
	}
});