// ==UserScript==
// @name Pixeldrain unlimited download
// @namespace Violentmonkey Scripts
// @match https://pixeldrain.com/u/*
// @match https://pixeldrain.com/l/*
// @grant none
// @version 1.4
// @author -
// @description 8/24/2025, 1:10:16 PM
// @license MIT
// @downloadURL none
// ==/UserScript==
function add_ddl_zip() {
const file_id = document.location.href.split("/").pop().split("#")[0];
const link = document.createElement('a');
link.href = `https://cdn.pd1.workers.dev/api/list/${file_id}/zip`;
link.innerHTML = '';
const aria2_input = document.createElement('a');
aria2_input.href = "data:text/plain;base64,"+btoa(Array.from(document.querySelectorAll("a.file.svelte-zfpa77 > div")).map(div => "https://cdn.pd1.workers.dev/api/file/" + div.style["background-image"].split("/")[3]).join("\n") + "\n");
aria2_input.download = `${file_id}.txt`;
aria2_input.innerHTML = '';
const toolbar = document.querySelector(".toolbar");
const button = toolbar.querySelector("button.button.svelte-1bj9uys");
toolbar.insertBefore(link, button);
toolbar.insertBefore(aria2_input, button);
}
function add_ddl_button() {
const file_id = document.location.href.split("/").pop().split("#")[0];
// Create the anchor element
const link = document.createElement('a');
link.href = `https://cdn.pd1.workers.dev/api/file/${file_id}`;
link.innerHTML = '';
const description = document.querySelector("div.description");
description.appendChild(link);
}
window.addEventListener('load', () => {
if (
document.location.pathname.startsWith("/u/")
) {
add_ddl_button();
}
else if (
document.location.pathname.startsWith("/l/")
) {
add_ddl_zip();
}
}, false);