GDrive: unable to access all shared folders if they have the same name using rclone

I am using rclone to access shared files on my google drive.

For example a Google Drive user shares two folder that has the same name. Hence, I am unable to access those both folders through rclone; I am only able to obtain the latest shared folder.

Those two folders are shared with my Google Drive.

$ ls foo
$ ls foo

On my rclone, I can only obtain the latest shared folder :

$ rclone ls remote: --drive-shared-with-me
   201942 foo/hello.txt
   201942 foo/hello.txt
$ rclone ls remote:foo --drive-shared-with-me

[Q] Is there any way to handle this issue?

I don’t think so. They look to rclone like duplicates. There is an issue on enhancing rclone to deal with duplicates which might help as then you could select which copy to deal with

Thanks @calisro for the response.

I was using ( that was allowing me to download folder through their unique ID: gdrive download --recursive ID_of_the_folder. I guess that option is not available through rclone.

$ gdrive list
    Id                                  Name                                       Type   Size     Created
    14IC1hufjb5WArh_75_G_dvmZgmlIK50V   doo                                        bin             2019-03-22 16:37:27
    1veladRJ4mfm6t0W9mntb8FILG-fqgQH2   doo                                        bin             2019-03-22 16:37:00 

As I understand, if there is duplicated shared folders with same folder name, I could only view the latest shared folder.

You can do that with rclone too if you use

  --drive-root-folder-id string                ID of the root folder
1 Like

I am getting following error @ncw

$ rclone ls remote:foo --drive-root-folder-id string
2019/03/25 14:14:08 ERROR : : error listing: couldn't list directory: googleapi: Error 404: File not found: ., notFound
2019/03/25 14:14:08 Failed to ls: couldn't list directory: googleapi: Error 404: File not found: ., notFound

If I able to obtain the ID of the root folder, by using it can I download its directory using rclone?

Yes, just paste it in where you wrote string above, so

rclone ls remote:foo --drive-root-folder-id '234JGfyhGFHF676767676'

Oh and you may still need --drive-shared-with-me not sure

On my google-drive I have created a folder names foo, please note that its not empty.

Its folderID is => “1aHL0-5rI1fyHuflDXJV5inYJ9ED5nyHA”

Following line worked: (I had to remove foo after remote:). I think there is no need to use --drive-shared-with-me.

$ rclone ls remote: --drive-root-folder-id '1aHL0-5rI1fyHuflDXJV5inYJ9ED5nyHA'

1 Like

In addition to that, through rclone with its --drive-root-folder-id;
=> Is it possible to obtain its info such as is it a Folder or gzip (Mime Type)?

$ gdrive info 1veladRJ4mfm6t0W9mntb8FILG-fqgQH2
Id: 1veladRJ4mfm6t0W9mntb8FILG-fqgQH2
Name: result-0xf2129928bd1e6f4aa1ad131a37db2e55810cbbff-0.tar.gz
Path: result-0xf2129928bd1e6f4aa1ad131a37db2e55810cbbff-0.tar.gz
Mime: application/gzip
Size: 4.7 KB
Created: 2018-05-03 19:23:38
Modified: 2018-05-03 19:23:38
Md5sum: ba834907726ce300c3e37048e32c1c65
Shared: True
Parents: 1KFlwAZUHXZ9DWS183cwViWJ5tf_51Smi

gdrive is able to return the information, can rclone do this as well? @ncw

You can use rclone lsf or rclone lsjson to read the mime type

I am not sure why but I guess --drive-root-folder-id seems like does not working. @ncw

$ gdrive info 1xnGc-FFWgYu2xflIWg9lYjnqWkyb0siR
Id: 1xnGc-FFWgYu2xflIWg9lYjnqWkyb0siR
Name: b5431f59c7a6fbcc2003362227044d07.tar.gz
Path: b5431f59c7a6fbcc2003362227044d07/b5431f59c7a6fbcc2003362227044d07.tar.gz
Description: b5431f59c7a6fbcc2003362227044d07.tar.gz
Mime: application/gzip
Size: 540.0 B
Created: 2019-03-26 13:48:28
Modified: 2019-03-26 13:48:30
Md5sum: b5431f59c7a6fbcc2003362227044d07
Shared: True
Parents: 1Y8LbCsojP5JADhSgbAGkV7732y7g5vC7

$ rclone ls remote:b5431f59c7a6fbcc2003362227044d07
      540 b5431f59c7a6fbcc2003362227044d07.tar.gz

Following line returns empty:

$ rclone ls remote: --drive-root-folder-id='1xnGc-FFWgYu2xflIWg9lYjnqWkyb0siR'

$ rclone ls remote:b5431f59c7a6fbcc2003362227044d07 --drive-root-folder-id='1xnGc-FFWgYu2xflIWg9lYjnqWkyb0siR'
2019/03/26 13:57:47 ERROR : : error listing: directory not found
2019/03/26 13:57:47 Failed to ls: directory not found

Is that a shared folder? If so I think you’ll need --drive-shared-with-me also

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.