amir1376 / ab-download-manager

A Download Manager that speeds up your downloads
https://abdownloadmanager.com
Apache License 2.0
3.33k stars 165 forks source link

[Feature] Import List #75

Closed zQueal closed 2 months ago

zQueal commented 2 months ago

The import from clipboard is nice, but what If I have a list of URI in my clipboard? Or what about just plain file import which dumps a URL list into a queue?

amir1376 commented 2 months ago

@zQueal Hi there.

Yes I agreed. I should implement a form of backup to also store download configs ( headers / user / user-agent etc.. ) as well alongside the URL into a file so they can be restored later.

what If I have a list of URI in my clipboard?

you can already copy a list of links and paste it to the app.

zQueal commented 2 months ago

you can already copy a list of links and paste it to the app.

Interesting, the whole reason why I opened this ticket was I tried it, and didn't see a way to do it. I copied a list of URI to my clipboard tried to import via clipboard and it only did the first URI.

Did I miss something?

amir1376 commented 2 months ago

@zQueal you just need the open the app and press Ctrl V a list will appear containing all the links and their info which you can select which one you want to add.( or just simply select all)

for example

https://example.com/a.txt
https://example.com/b.txt
https://example.com/c.txt

if you still can't import them, tell me how can I reproduce the problem you faced. maybe there is a bug or sowthing.

zQueal commented 2 months ago

Yeah, this still doesn't seem to work as I would expect. I have about 30 cbz files in my clipboard. Hitting ctrl+v tries to download an html file versus adding all 30 of the cbz files to the queue as one would expect. In fact, it doesn't even recognize the actual download filetype and instead tries to download the directory in which they're all stored.

Even doing a single file download instead of actually attempting to download the cbz it just makes a html file for some reason. :shrug:

amir1376 commented 2 months ago

@zQueal then it seems there is a bug here

if its possible provide a reproduceable steps so I can test and debug it.

zQueal commented 2 months ago

Sure.

  1. View HTTP directory with links in it.
  2. Use Link Grabber chrome extension to put links into clipboard.
  3. Open ab-download-manager and click ctrl-v.
  4. Puts https://domain.dev/path/tofiles/ as download target with a filename of homain.html.

Links in the clipboard are links to direct objects.

amir1376 commented 2 months ago

@zQueal Unfortunately I couldn't reproduce the bug you mentioned I use the tool you mentioned and it works correctly. here is the result

image

Even doing a single file download instead of actually attempting to download the cbz it just makes a html file for some reason. 🤷

Maybe your link requires authentication ( some download links requires specific cookies/headers /user-agent to allow download that resource ) in that case (the html file extension you mentioned usually is an error webpage) when you use the app's browser extension it will be handled automatically

zQueal commented 2 months ago

So here's the directory, which again is just a regular webserver directory;

image

I click "copy" to copy all 180 links to my clipboard. I open the web interface and hit ctrl+v;

image1

There's no redirect or anything going on. They're all direct files. I tried downloading a few directly, and they all work fine.

If I copy a single URI and paste it, it seems to work as intended;

image2

Otherwise something weird is happening.

amir1376 commented 2 months ago

@zQueal

If I understand correctly... you are pasting a list of links in to add download page (this is for single link which has more options.)

in your case you need press on ctrl v in the APP"s Main Window or using menu bar by clicking on File >> import from clipboard

zQueal commented 2 months ago

in your case you need press on ctrl v in the APP"s Main Window

Yes, this is what I've done in my example. As a test, I went to the releases page of ab-download-manager and grabbed a bunch of the releases into my clipboard, and it works just fine;

image

I do the exact same thing with the previous URI, and it doesn't work. As you can see from here, they're direct files;

image2

I don't really have an explanation as to why they're not being picked up.

amir1376 commented 2 months ago

@zQueal now I'm sure that this is a bug in the url parsing. if you face that in some links that are not private and can be shared please send them to me (you can also text ne in telegram), so I can fix this bug!

amir1376 commented 2 months ago

@zQueal the problem is because the WebServer that you are using, uses a non standard URL format. although they are supported by browser (and also this app) but they shouldn't have [ , ], space etc... in their path segment. instead they should be URL Encoded

because of that the URL regex couldn't properly find the links that you provided. in your case you can already use the ABDM's browser extension which handles this.

but now I fix this in the app too, by adding an extra check (multi link in multi line) before the URL Regex.