GM_DL

GM_download but it actually works

Bu script direkt olarak kurulamaz. Başka scriptler için bir kütüphanedir ve meta yönergeleri içerir // @require https://update.greasyfork.org/scripts/523457/1519388/GM_DL.js

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        GM_DL
// @namespace   Violentmonkey Scripts
// @grant       GM.xmlHttpRequest
// @version     1.3
// @author      https://greasyfork.org/en/users/1409235-paywalldespiser
// @description GM_download but it actually works
// @license     MIT
// @require     https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js
// ==/UserScript==

/**
 * Arguments for GM_DL
 *
 * @typedef {object} GM_DL_ARGS
 * @property {string | URL} url
 * @property {string} filename
 * @property {("GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "TRACE" | "OPTIONS" | "CONNECT")} [method='GET']
 * @property {("follow" | "error" | "manual")} [redirect='follow']
 * @property {string | undefined} data
 * @property {{ [key: string]: string; } | undefined} headers
 */
/**
 * GM_download but it actually works
 *
 * @param {GM_DL_ARGS}
 * @returns {Promise<void>}
 */
function GM_DL({
    url,
    filename,
    method = 'GET',
    redirect = 'follow',
    data,
    headers,
}) {
    return GM.xmlHttpRequest({
        url,
        method,
        responseType: 'blob',
        redirect,
        data,
        headers,
    }).then(({ response }) => saveAs(response, filename));
}