How can I do the equivalent of "Add to My Drive" in rclone?


#1

My workflow 8s usually like below.

  1. Have a set of folders that’s shared with me.
  2. Go to Drive website and “Add to My Drive” for those folders
  3. Work on the shared folder via rclone

I want to eliminate no 2 and do it via rclone. How can I do that?
Something like rclone --addshares https://drive.Google.com/folders myremote:


#2

You can use the --drive-shared-with-me flag which will only show you stuff shared with you. Not sure that will work with your workflow, but it might…


#3

That flag only work after they shared the folder to your account. My workflow is more of finding shared folders not necessarily being shared to my specific account. Then I usually click “Add to My Drive” which then after that it will be available to the flag you mention.

I was looking for more into adding a folder into my shared folder via rclone.

For example
https:// drive.google.com/file/d/1p8mSpj6itw1-WQDIvTpHViZla-OQvLsu/

https://drive.google.com/drive/u/0/mobile/folders/1VS6OKSRJaEzTSBbFFra2NFoJlAvYiPoY

Above file or folder are publicly shared. 8 would then click “Add to My Drive” so they are available as my Shared Drive.

What I’m looking to do via rclone is above. Something like

“rclone --addshares https://drive.google.com/drive/u/0/mobile/folders/1VS6OKSRJaEzTSBbFFra2NFoJlAvYiPoY GDriveremote:”

to add that folder into my GDrive account as my shared folder.


#4

I see. The API for doing this is straight forward. Why do you want to do it with rclone - will you have a list of URLs somewhere?


#5

Yes. So typically I already have list of urls ready. I add them to my drive,work on them and either keep it that way or delete the shared folders from my drive. Currently I have to add them via gui Web browser, very time consuming…
So if I can use rclone to do this it will save a lot of time.

Something like rclone --addshares and rclone --removeshares


#6

I could add this to rclone, but since it only applies to one backend (drive) I’m reluctant to!

Are the other command line tools which could help?


#7

I could add this to rclone, but since it only applies to one backend (drive) I’m reluctant to!

I understand your point. I’m not familiar with other cloud providers way of sharing files and folders but I would think they all need a way to add folder and file as shared folders.

There’s no other command line tools that could help for Google Drive. For other cloud provider such as mega.nz there’s megaous tool etc. But not for Google drive.

If you are reluctant to add for only Google drive, I understand, but this also similarly applies to other backend. In mega.nz I have to use mega.nz website to add folders into my mega.nz account before I can work on them with rclone.

For Microsoft one drive too. I have to use onedrive website to save shared folders to my corporate domain onedrive account. Without this I can’t access it from rclone. It’s even worse in the case of Microsoft onedrive because that action above means a real copy of those folders and files that will take long time to finish. This is as opposed to Google drive that does this instantly because it only links the folders and put them inside “My Drive”


#8

If it is applicable to more than one cloud provider then I’d be willing to entertain the idea!

It would be a separate command rclone addobject remote: ID let’s say.

Can you please make a new issue on github about this with as much detail as possible as how you’d like the new command to work.

Better still - maybe you could help with the implementation?