rclone / rclone/rclone

Dropbox: add support for reading shared links (distinct from shared files, shared folders)

Open
#6,608 6 comments 30 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Remote: Dropbox
Dominant language
Go
Stars
59.8k
Forks
5.4k
Avg merge
2d 14h
Merged PRs (30d)
48

Description

The associated forum post URL from https://forum.rclone.org

I've not created a forum post, but this feature has been discussed with varying degrees of accuracy at:

[^otherissues]:

What is your current rclone version (output from rclone version)?

rclone v1.59.1

  • os/version: debian bookworm/sid (64 bit)
  • os/kernel: 6.0.0-1-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.18.5
  • go/linking: static
  • go/tags: none
What problem are you are trying to solve?

It appears that rclone has no way to read/pull files that have been shared by a third party as "Shared Link"s (where a publically-accessible link is created), as opposed to "Shared Folders" and "Shared Files" which are shared to specific user accounts and appear in the "Shared" listing for that user, and may be mounted to their dropbox area and accessed with --dropbox-shared-[folders|files].

These shared links do not appear in one's own dropbox account as shared folders, and when accessing their URLs in a browser, the only options presented are to "Download" (which will serve a zip file of the entire shared file/folder), or "Save to Dropbox" which creates a local copy of the share in one's own dropbox account, which is detached from the original share, uses one's own quota and won't be updated with changes from the original source.

Here's a working example of such a shared link: https://www.dropbox.com/sh/o4p5od3yzzj7384/AADovh3gpXiPyPoygeB6Cwi1a?dl=0

Which renders like this, regardless of whether one is logged in or anon:
image

Most reports and answers I have found either deal with shares to a user, which will appear in the shared items listing, or suggest changing to a share method that does this, or state that it cannot be done [^otherissues]. I found this potential solution via a 7 year old SO answer at https://stackoverflow.com/questions/34107525/getting-list-of-files-and-folders-in-public-dropbox-folder-and-downloading-files

How do you think rclone should be changed to solve that?

The API specifies methods for /get_shared_link_metadata and /get_shared_link_file which I believe will provide the required features. It looks like these endpoints are present in the go api as well, and I couldn't find any existing use of them in the rclone repo other than the one use mentioned above.

I'm not experienced with the dropbox api nor rclone's codebase, but it looks to me like the get_shared_link_metadata endpoint can be passed the raw URL of the shared link, and the response may(?!) contain an ID for the object, which I assume can then be used to access the folder/file.

I would envision an option could be added (--dropbox-shared-link perhaps?) which would allow specifying the shared link url in a way similar to the http remote, providing a read-only remote that can be listed and pull-synced. eg:

rclone lsd --shared-link-url https://www.dropbox.com/sh/o4p5od3yzzj7384/AADovh3gpXiPyPoygeB6Cwi1a?dl=0 :dropbox:
or
rclone lsd dropboxremote:https://www.dropbox.com/sh/o4p5od3yzzj7384/AADovh3gpXiPyPoygeB6Cwi1a?dl=0 --dropbox-shared-link
(whichever is more in line with rclone's style).

Currently the documentation does not seem to mention the specific "shared link" style of dropbox sharing which seems to be an on-going point of confusion for others trying to find a similar solution, as the "shared-files"/"shared-folders" modes are distinctly different from a "shared-link" case.

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Dropbox's get_shared_link_metadata and get_shared_link_file API endpoints and the existing GetSharedLinkFile use in rclone's Dropbox backend. Compare shared-link behavior with the existing shared-files and shared-folders modes; done means a read-only shared-link remote can list and pull content, with Dropbox documentation distinguishing these sharing types.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.