nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
3.01k stars 791 forks source link

Access direct link instead of randomized public link via client #3382

Open jonvog opened 3 years ago

jonvog commented 3 years ago

How to use GitHub

Is your feature request related to a problem? Please describe. I very often need to embed video files in a 3rd party app (CueDB). This app needs public direct links to work and I'd like to access these direct links directly via the context menu in the Nextcloud folder in my local file explorer. At the moment I have to create a public link, paste it to a browser, open it, right click the download button and copy the link address. It is possible, but very inconvenient, if I have to do this a lot.

Describe the solution you'd like I would like to have another entry in the file explorer context menu that lets me copy the direct link instead of the default public link.

Describe alternatives you've considered A setting that lets me choose whether "copy public link" copies the randomized public link or the direct link into the clipboard.

Additional context Dropbox does this exactly as I want it to (but I'd like to use Nextcloud instead)

FlexW commented 3 years ago

@kesselb is there already an API on the server that allows us to get that link?

kesselb commented 3 years ago

Hey @FlexW,

sorry for my late reply. I don't think we include the url to download a file directly somewhere. It should be possible to generate the url to download a url if you know the token. filename is optional.

Show share: /s/{token} Download share: /s/{token}/download/{filename}

https://github.com/nextcloud/desktop/blob/4992977167b8cfc2319a6f642d1c08c02cf4f670/src/gui/sharemanager.cpp#L176-L181

This approach looks correct to me. getDirectDownloadLink is not used in desktop.

https://github.com/nextcloud/desktop/pull/2234 and https://github.com/nextcloud/desktop/issues/2230 look related.