eight04 / image-picka

A Firefox/Chrome extension helping you download images.
MIT License
161 stars 19 forks source link

Allow "Copy URLS" to select even error-disabled images #301

Open Deeterween opened 2 years ago

Deeterween commented 2 years ago

I'm very new at all of this stuff myself, and I was trying to dabble through the code, but I couldn't find what I as looking for. Would there be a way to copy urls of images grabbed even if they can't be downloaded by image-picka? For instance, be able to 'unfilter' those with errors at least for the purposes of using the "Copy URLs" button.

Thanks for taking a look!

Deeterween commented 2 years ago

I have discovered through a little more digging that cache-downloading can get around this in at least some of the instances, but it would be highly convenient to also have the ability to collect the error-coded images with 'Copy URLs', perhaps a separate "Copy all URLs" button?

thanks again!

eight04 commented 2 years ago

Here is the code for copying URLs in picker: https://github.com/eight04/image-picka/blob/6a05e976ea111ab6a5ea719cd176071c1a0caf39/src/picker.js#L140-L145 getUrls only returns selected/enabled image URLs.

You can try replacing getUrls with something like:

const images = getImages();
const urls = images.map(i => i.url);
input.value = urls.join("\n");