dbxcli icon indicating copy to clipboard operation
dbxcli copied to clipboard

Implementing sharelink feature requested in #77

Open banool opened this issue 6 years ago • 20 comments

This is in response to #77.

Following the current command structure for dbxcli, the new command can be found at dbxcli share getlink.

If the file / folder already has a sharelink, that link is retrieved and printed. This follows the pre-existing printing format from the sharing functions. If it doesn't have a sharelink, the link is created and printed.

There is also support for getting links for files that haven't fully uploaded yet. I wanted to functionality to be precisely like if you right click on a file and use Copy Dropbox Link. The side effect of this is I had to use the partially deprecated create_shared_link endpoint.

This is the first Go I've ever coded so I'm of course open to revisions.

banool avatar Jan 03 '18 01:01 banool

I addressed all of the issues except those related to getDropboxFolder.

banool avatar Jan 11 '18 08:01 banool

Any ETA on when this feature can be live?

coatless avatar Jan 17 '18 02:01 coatless

@coatless Just waiting on the go ahead from @diwakergupta, as well as perhaps a cleaner way to do the functionality provided by getDropboxFolder.

banool avatar Jan 18 '18 23:01 banool

@diwakergupta Think you could have another look at this?

banool avatar Feb 25 '18 23:02 banool

@banool @diwakergupta it would be great to see headway on this feature as the ~/dropbox.py script listed under Linux Installation appears to be at EOL given:

root@remote:~# ~/dropbox.py status
You're using an old version of Dropbox. Please update within the next 4 days to continue using Dropbox.

https://www.dropbox.com/downloading?from_client=True
Up to date

coatless avatar Mar 30 '18 01:03 coatless

Sorry folks, will take a look right away!

diwakergupta avatar Mar 30 '18 03:03 diwakergupta

@diwakergupta Any update on this PR? I'd love to use this command.

I installed dbxcli only for this purpose because my current workflow is:

  • open -r myfile
  • Right click on the file: copy shareable link

MartinDelille avatar Sep 14 '18 16:09 MartinDelille

@banool is there a way to install your version to test it?

MartinDelille avatar Sep 17 '18 15:09 MartinDelille

Bumping this, I would love to see this feature incorporated into the main branch.

cahebert avatar Oct 22 '19 23:10 cahebert

I would love to have this PR merged too!

batt avatar Nov 11 '19 10:11 batt

@diwakergupta any update on if this will get merged? It would be really nice to have.

vlaminck avatar Nov 15 '19 14:11 vlaminck

I know this is super old and seems to not actually be maintained any more, but when I try to go build your branch, I get this error:

./main.go:43:24: cannot use versionCmd (type *"github.com/banool/dbxcli/vendor/github.com/spf13/cobra".Command) as type *"github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra".Command in argument to cmd.RootCmd.AddCommand

vlaminck avatar Nov 15 '19 19:11 vlaminck

Sadly, I think this software is official dead. I wouldn't push forward more on this as it literally was a year and then some. Consider looking into Dropbox alternatives.

coatless avatar Nov 15 '19 19:11 coatless

Unfortunately yes, I haven't looked into this PR for a long time. I don't intend to pick up the work again either since, as @coatless says, this appears to be entirely dead. Dropbox seems to be more interested in the designer / creative space than the technical space these days, so I don't expect to see any further development on this either. Given the recent price increase and worsening features relative to competitors, might be time to look elsewhere.

banool avatar Nov 23 '19 16:11 banool

Yeah, I figured that'd be the case. Thanks for the responses.

If anyone finds this in the future, here's a Groovy script that I wrote to accomplish what I needed. https://gitlab.com/snippets/1915960

vlaminck avatar Nov 23 '19 17:11 vlaminck

I wanted to give it a look and I manage to make it work!

I rebased the PR (otherwise I had a segmentation fault).

$ dbxcli share getlink ~/Dropbox/Flyers\ Lyon.jpg
2019/11/23 19:38:45 client.go:619: WARNING: API `CreateSharedLink` is deprecated
2019/11/23 19:38:45 client.go:620: Use API `CreateSharedLinkWithSettings` instead
Flyers Lyon.jpg	https://www.dropbox.com/s/1mvz1bhiq7csq1l/Flyers%20Lyon.jpg?dl=0

As you can see, CreateSharedLink is deprecated but it shouldn't be a problem to fix that.

Regarding the output I would remove the file name in order to make the result "pipable":

$ dbxcli share getlink ~/Dropbox/Flyers\ Lyon.jpg | pbcopy

(for non MacOS user, pbcopy copy the input in the clipboard)

MartinDelille avatar Nov 23 '19 18:11 MartinDelille

To anybody interested in that option:

https://github.com/dropbox/dbxcli/issues/113#issuecomment-667919621

biounix avatar Aug 03 '20 09:08 biounix

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 16 '22 21:04 CLAassistant

I'm unsubscribing from this, please tag me if you need me if the maintainers ever return. Thanks!

banool avatar Apr 19 '22 23:04 banool

@banool If you want to get notified, stay subscribed because I don't think I will remember to ping you when it merged (there is not so much activity here anyway).

@biounix I just tried tbx for the first time after having it under my watched repository since you mentioned it. I opened a question here about it.

MartinDelille avatar Apr 20 '22 10:04 MartinDelille