AltSoft Links Generator

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

Versione datata 18/04/2024. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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);
    });
})();