deontic / npm-imgbb-bulk-downloader

Download images from imageBB in bulk via npm package. Web-based version available as well.
MIT License
4 stars 0 forks source link

The package does not work for me. #3

Closed zns-commits closed 2 years ago

zns-commits commented 2 years ago

Hello, I tried your package with the same example script you put in the documentation.

I simply replaced your links with my own: I put here the script :

const imgbulk = require("@un-index/imgbb-bulk")

const urls = `https://ibb.co/vjsWTxP
https://ibb.co/GJJ0T5g
https://ibb.co/HKPfJG8
https://ibb.co/0jxMFvW
https://ibb.co/pJT1hy8
https://ibb.co/Kb4NVL1
https://ibb.co/K7p6PZ0
https://ibb.co/FB6DSTz
https://ibb.co/JcR7K3y
https://ibb.co/VNBHmkn
https://ibb.co/nRv7Q3X`;

imgbulk(urls);

I then ran the command "node index.js". and here is the error I got :

jb@Aspire-E5-571G:~/Téléchargements/npm$ node index.js
/home/jb/Téléchargements/npm/node_modules/@un-index/imgbb-bulk/index.js:30
                let name = doc.match(/data-text="image-title">(.*)</)[1]
                                                                     ^

TypeError: Cannot read properties of null (reading '1')
    at /home/jb/Téléchargements/npm/node_modules/@un-index/imgbb-bulk/index.js:30:70
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Can you help me please?

Thank you for your help.

deontic commented 2 years ago

Sorry for the late reply. You can try out the web version for now: https://un-index.github.io/imgBB-web-bulk-downloader/

Not sure why this isn't working I'll take a look at it later.

deontic commented 2 years ago

The issue was with the latest npm version using original image names for the downloaded filenames . Temporary fix would be to use the version published right before that one:

npm uninstall @un-index/imgbb-bulk
npm i https://github.com/Un-index/npm-imgbb-bulk-downloader
deontic commented 2 years ago

Just fixed it. You can now use the regular npm version (make sure you have the latest version) and it retains original filenames.