AltSoft Links Generator

Генерирует ссылки для скачивания изображений с сайтов на движке КАИСА-Архив (Альт-Софт)

Verze ze dne 18. 04. 2024. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         AltSoft Links Generator
// @namespace    nikku
// @license      MIT
// @version      0.1
// @description  Генерирует ссылки для скачивания изображений с сайтов на движке КАИСА-Архив (Альт-Софт)
// @author       nikku
// @match        https://archiveslo.ru/srv/imageViewer/turn*
// @match        https://archiveslo.ru/srv2/imageViewer/turn*
// @match        https://fgurgia.ru/imageViewer/turn*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=archiveslo.ru
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js
// @grant        unsafeWindow
// ==/UserScript==

/* global saveAs */

(function() {
    'use strict';

    var path = unsafeWindow.hostPath;
    var urls = unsafeWindow.urls;
    var pages = unsafeWindow.numberOfPages;
    var rand = crypto.randomUUID().substring(0, 8);
    var file = window.location.hostname + '_links-' + pages + '_' + rand + '.txt';
    var btnHtml = '<button type="button" title="Скачать список ссылок" class="button btnDownload" id="btn_links"></button>';
    var text = '';

    if (urls.length) {
        urls.forEach(function (id) {
           text += path + '/image?url=' + id + '\r\n';
        });
    }

    document.querySelector('.slide_buttons').insertAdjacentHTML('beforeend', btnHtml);
    document.querySelector('#btn_links').addEventListener('click', function() {
        saveAs(new Blob([text], {type: 'text/plain;charset=utf-8'}), file);
    });
})();