downthemall / downthemall

The DownThemAll! WebExtension
https://downthemall.org/
Other
911 stars 104 forks source link

Export links with target path #482

Open xmstspider opened 8 months ago

xmstspider commented 8 months ago

I love the option to export list of links into a text file, but what I'm missing is an option to save target path as well.

I would like to be able to export links as something like CSV file, where first column would be the URL and second one the path relative to download root path (e.g. ~/Downloads), so this file could be fed into e.g. a script which would generate CURL/WGET links.

An example of exported CSV would be:

# url,relative path
https://github.com/k3s-io/k3s/releases/download/v1.28.3%2Bk3s1/k3s-airgap-images-amd64.tar,k3s/1.28.3

Is something like that possible?

Thank you

thany commented 7 months ago

Was looking for this too. Sometimes the browser needs a restart, or the computer does, and pending downloads do not survive a restart. Which is another bug (or missing feature, but honestly a bug to me).

I find it a bit of an oversight that export of a program's own data does not include all information known. The destination filename (and directory!!) can be pretty important when multiple sets of downloads are in the queue.

So the current workaround is to wait, keep the computer running and Firefox alive, until those downloads have finished. This could take days if a host happens to be slow.

nmaier commented 5 months ago

The "subfolder" should be exported at least in the meta4 export, and imported from meta4, so I just added code to that effect.

As for introducing new formats, I don't really like CSV as it is very vaguely defined and there are a ton of different "dialects". I'd rather do something like a json export, which should be easy enough to consume in scripts of all kinds, but is a far more well-defined format in general.

thany commented 5 months ago

It doesn't really matter (to me) which format you choose, as long as exports can also be imported.

You'd be surprised how much software is unable to import its own exports 😬

xmstspider commented 5 months ago

As for introducing new formats, I don't really like CSV as it is very vaguely defined and there are a ton of different "dialects".

Technically you don't need to think about CSV dialects at all, the same way you save the links to links.txt, you may just create links.csv like this (delimiter may be e.g. semicolon or comma):

link1;subfolder1
link2;subfolder1
link3;subfolder2

It's more than enough :-)