aertslab / nextcloud_share_url_downloader

Download files from and list content of NextCloud (password protected) share directly from the command line without needing a webbrowser.
MIT License
23 stars 11 forks source link

downloading single file #2

Open JochemBoersma opened 3 years ago

JochemBoersma commented 3 years ago

First of all: many thanks for this tool. Very useful for large data transfers!

When the download link directs towards a single file, it won't download, since it is build for folders, isn't it? To test this, i've made a document on my own Nextcloud instance, called: testfile-for-issue.txt

The share link: https://nextcloud.metjedata.nl/s/MXYzWBnYMTttkPA password: wEjjNEYD68

I've made a single-shot workaround by commenting lines 285-288 (and 291) and changing line 290 into:

download_file_from_nextcloud_share "${nextcloud_host_url}/public.php/webdav${nextcloud_file_or_dir_name}" hoppakee.txt;

which results in a hoppakee.txt file in the current working directory of the client.

Would be nice if this can be generalized, but I haven't that much bash-experience.

ghuls commented 3 years ago

As you noticed, for now only directory shares are supported as that is how the NextCloud share links I get, are.

I didn't use it myself, but it is possible that the following supports it (It supports at least more than just donwloading): https://github.com/Nucleomics-VIB/cloud-dl

JochemBoersma commented 3 years ago

Thanks for quick response. I will take a look, but for now I'll use my own dirty quick fix.