dlm icon indicating copy to clipboard operation
dlm copied to clipboard

case where the path is the same in the `links.txt`

Open anandijain opened this issue 1 year ago • 2 comments

hey again, love dlm! and thanks for your help in the past

https://static.case.law/us/1/CasesMetadata.json
https://static.case.law/us/2/CasesMetadata.json
https://static.case.law/us/3/CasesMetadata.json
...

the problem i ran into was

[2024-12-18 00:13:52] Skipping CasesMetadata.json because the file is already completed [299.39KiB]                 
[2024-12-18 00:13:52] Skipping CasesMetadata.json because the file is already completed [299.39KiB]                 
[2024-12-18 00:13:52] Skipping CasesMetadata.json because the file is already completed [299.39KiB]           
...      

the problem is that these files are actually distinct, but i couldn't find a way to tell dlm the names that i wanted to use or to canonicalize them to be unique in some way.

i dont want to complicate this beautifully simple package too much, but this case might be useful to handle

anandijain avatar Dec 18 '24 08:12 anandijain

Thanks for opening this!

I believe this is a recurring issue that could be handled by dlm natively.

My first idea would be to use the segments in the URL to name the files.

e.g.

https://static.case.law/us/1/CasesMetadata.json
https://static.case.law/us/2/CasesMetadata.json
https://static.case.law/us/3/CasesMetadata.json

to

us-1-CasesMetadata.json
us-2-CasesMetadata.json
us-3-CasesMetadata.json

I guess there are edge cases requiring additional chars sanitization to make sure the names are valid :thinking:

WDYT?

agourlay avatar Jan 02 '25 10:01 agourlay

great solution to me! means not adding more args

anandijain avatar Jan 02 '25 18:01 anandijain

is it possible for this precise case to have a parameter / switch for dowloading with path?

example.com/path/to/file.iso

would be saved on disk as

./path/to/file.iso

the same way some unarchiving tools can dump the files with path or without path.

SplendidSwifter avatar Feb 21 '26 21:02 SplendidSwifter