Copy all Artstation Image links to Download

Add a button to copy all image links at Artstation page to bulk download.

目前為 2023-06-01 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Copy all Artstation Image links to Download
// @namespace    Violentmonkey Scripts
// @version      1.0.1
// @description  Add a button to copy all image links at Artstation page to bulk download.
// @author       Wizzergod
// @match        https://*.artstation.*/*/*
// @grant        GM_setClipboard
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function copyLinksToClipboard() {
        var links = Array.from(document.querySelectorAll('a[download]')).map(link => link.href);
        GM_setClipboard(links.join('\n'), 'text');
        alert('Links copied to clipboard!');
    }

    var copyButton = document.createElement('button');
    copyButton.innerText = 'Copy Links';
    copyButton.className = 'bs-btn bs-btn-primary';
    copyButton.style.cssText = `
        padding: 10px 20px 10px 16px;
        border-radius: 8px;
        display: flex;
        flex-direction: row;
        font-weight: 500;
        gap: 8px;
        justify-content: flex-start;
        line-height: 100%;
        color: black; /* Set the text color to black */
    `;
    copyButton.addEventListener('click', copyLinksToClipboard);

    var targetElement = document.querySelector('ul.menu-level-1-buttons.sm-gap-medium');
    var listItem = document.createElement('li');
    listItem.appendChild(copyButton);
    targetElement.appendChild(listItem);
})();