Download all owned files from Google Drive in Shares

Hi,
We have lot of files stored in various users Google Drive. I have uploaded files to a share which belongs to another user. So the files owner is still me because I uploaded the file.
With --drive-auth-owner-only my file is never downloaded. Not in my download as file owner and not in the download of the owner of the shared folder.
Without that parameter the file is downloaded twice. This is only an example. In reality we have hundreds of thousands of files that would be downloaded x times and this would be a problem.
Any idea on that?
Regards,
Sony

:frowning:

Why is it downloaded twice? What do the rclone logs look like? Do you see it twice if you do an rclone ls?

The shared folder is owned by user 1. The user 2 has added the shared folder to his ‘My Drive’ and stored a file in it.
On download the file is the downloaded twice (on both users), I think because it can be seen in the shared folder in both users ‘My Drive’. rclone ls also shows the file twice.
And with --drive-auth-owner-only the file isn’t downloaded at all and rclone ls doesn’t show it.

The way --drive-auth-owner-only works is it looks through the owners of a file and checks if the me flag is set. See the API docs for the definitions of the fields.

So it must be google returning that the file isn’t owned by you I think.

If you do this…

rclone -vv --drive-auth-owner-only --dump-bodies ls drive:path/to/a/file

You’ll see something like this at the end

{
 "files": [
  {
   "id": "1t7DA1Xsg_dElagvlr-wtRaIBFlrLY-tN",
   "name": "date.txt",
   "mimeType": "text/plain",
   "trashed": false,
   "createdTime": "2018-01-29T11:44:53.681Z",
   "modifiedTime": "2018-01-29T11:45:36.605Z",
   "owners": [
    {
     "kind": "drive#user",
     "displayName": "Nick Craig-Wood",
     "photoLink": "https://lh3.googleusercontent.com/-wP_Dh_m9kJc/AAAAAAAAAAI/AAAAAAAAEBE/m8ETvnfBPCA/s64/photo.jpg",
     "me": true,
     "permissionId": "17383914067640380997",
     "emailAddress": "XXXXXX@gmail.com"
    }
   ],
   "md5Checksum": "ae2ffbcbe74bc7f56ff9c4e9ef2919cf",
   "size": "29"
  }
 ]
}

What does that look like for you? And have you tried the latest beta?

I’ve just downloaded the latest beta and did some tests. Here are the logs:

U:\rclone>
U:\rclone>rclone ls User_Drives: --drive-impersonate=test1@… --drive-auth-owner-only
-1 tester01.docx
-1 tester01/tester01.xlsx

U:\rclone>rclone ls User_Drives: --drive-impersonate=test2@… --drive-auth-owner-only

U:\rclone>

====

U:\rclone>rclone -vv --drive-auth-owner-only --dump-bodies ls User_Drives:tester01 --drive-impersonate=test1@…

…
{
“files”: [
{
“id”: “1LaU2PglAjRCNkSlKglonM_7sBmNOfb5j2T6B5RZsUZE”,
“name”: “tester02”,
“mimeType”: “application/vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-19T02:05:23.601Z”,
“modifiedTime”: “2018-02-19T02:05:35.749Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test2”,
“me”: false,
“permissionId”: “08692407437160094243”,
“emailAddress”: “test2@…”
}
]
},
{
“id”: “19Fj5bKYQPWtS6dxOr-nt7_GirVgfQiVG8v74DvFtVhs”,
“name”: “tester01”,
“mimeType”: “application/vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-19T02:03:08.687Z”,
“modifiedTime”: “2018-02-19T02:03:26.899Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: true,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
}
]
}
…

===

U:\rclone>rclone -vv --drive-auth-owner-only --dump-bodies ls User_Drives:tester01 --drive-impersonate=test2@…

…
{
“files”: [
{
“id”: “1LaU2PglAjRCNkSlKglonM_7sBmNOfb5j2T6B5RZsUZE”,
“name”: “tester02”,
“mimeType”: “application/vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-19T02:05:23.601Z”,
“modifiedTime”: “2018-02-19T02:05:35.749Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test2”,
“me”: true,
“permissionId”: “08692407437160094243”,
“emailAddress”: “test2@…”
}
]
},
{
“id”: “19Fj5bKYQPWtS6dxOr-nt7_GirVgfQiVG8v74DvFtVhs”,
“name”: “tester01”,
“mimeType”: “application/vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-19T02:03:08.687Z”,
“modifiedTime”: “2018-02-19T02:03:26.899Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: false,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
}
]
}
…

BTW I forgot to mention that we use a service account config, therefore the additional parameters. Could this cause the problem?

From your logs above, it looks like google is returning the “me” flag relating to the --drive-impersonate

Hmm, quite possibly!

I understand from your post that

rclone ls User_Drives: --drive-impersonate=test2@… --drive-auth-owner-only

returned no entries, but when you ran it with --dump-bodies

rclone -vv --drive-auth-owner-only --dump-bodies ls User_Drives:tester01 --drive-impersonate=test2@…

I can clearly see that it returned an “owner” with “me: true” which it definitely should have printed so it should have printed “tester02.xslx”

Is that correct? Can you double check that for me please? I see in the first try you uses the remote User_Drives: but the second User_Drives:tester01.

It would be helpful for me if I could see the complete output of the commands - feel free to redact email addresses and anything else you like.

Thanks

C:\rclone>rclone ls User_Drives: --drive-impersonate=test1@… --drive-auth-owner-only
-1 Doc in root of test01 - file owner test01.docx
-1 tester01_Sheet in shared folder tester01 (owned by test01) - file owner test01.xlsx

C:\rclone>

===

C:\rclone>rclone -vv --drive-auth-owner-only --dump-bodies ls User_Drives: --drive-impersonate=test1@…
2018_02_20 13:22:52 NOTICE: --dump-bodies is obsolete - please use --dump bodies instead
2018_02_20 13:22:52 DEBUG : Using config file from “c:\…\rclone.conf”
2018_02_20 13:22:52 DEBUG : rclone: Version “v1.39-161-gafc963ed” starting with parameters [“rclone” “-vv” “–drive-auth-owner-only” “–dump-bodies” “ls” “User_Drives:” “–drive-impersonate=test1@…”]
2018_02_20 13:22:52 INFO : Google drive root ‘’: Modify window is 1ms
2018_02_20 13:22:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:52 DEBUG : HTTP REQUEST (req 0x13b07a00)
2018_02_20 13:22:52 DEBUG : POST _o_oauth2_token HTTP_1.1
Host: accounts.google.com
User-Agent: rclone_v1.39-161-gafc963ed
Content-Length: 859
Content-Type: application_x-www-form-urlencoded
Accept-Encoding: gzip

assertion=…
2018_02_20 13:22:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:52 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:52 DEBUG : HTTP RESPONSE (req 0x13b07a00)
2018_02_20 13:22:52 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Disposition: attachment; filename=“json.txt”; filename*=UTF-8’'json.txt
Content-Type: application_json; charset=utf-8
Date: Tue, 20 Feb 2018 12:22:56 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: ESF
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

fa
{
“access_token” : “…”,
“expires_in” : 3600,
“token_type” : “Bearer”
}
0

2018_02_20 13:22:52 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:52 DEBUG : HTTP REQUEST (req 0x13d4a100)
2018_02_20 13:22:52 DEBUG : GET _drive_v3_files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cowners%29%2CnextPageToken&pageSize=1000&q=trashed%3Dfalse+and+%27root%27+in+parents HTTP_1.1
Host: www_googleapis_com
User-Agent: rclone_v1.39-161-gafc963ed
Authorization: XXXX
Accept-Encoding: gzip

2018_02_20 13:22:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:53 DEBUG : HTTP RESPONSE (req 0x13d4a100)
2018_02_20 13:22:53 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application_json; charset=UTF-8
Date: Tue, 20 Feb 2018 12:22:56 GMT
Expires: Tue, 20 Feb 2018 12:22:56 GMT
Server: GSE
Vary: Origin
Vary: X-Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

3c0
{
“files”: [
{
“id”: “1EuLtoxkP6OETcCdoVNnbbqGVKFPkyilZ”,
“name”: “tester01”,
“mimeType”: “application_vnd.google-apps.folder”,
“trashed”: false,
“createdTime”: “2018-02-19T02:03:00.004Z”,
“modifiedTime”: “2018-02-20T12:19:47.042Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: true,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
},
{
“id”: “1L7vKJQi6WIXGDjbA6BwCEELNWr46XBakYsx_2DeryT8”,
“name”: “Doc in root of test01 - file owner test01”,
“mimeType”: “application_vnd.google-apps.document”,
“trashed”: false,
“createdTime”: “2018-02-19T02:02:29.984Z”,
“modifiedTime”: “2018-02-20T12:04:18.155Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: true,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
}
]
}

0

2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:53 DEBUG : HTTP REQUEST (req 0x13d4a300)
2018_02_20 13:22:53 DEBUG : GET _drive_v3_about?alt=json&fields=exportFormats HTTP_1.1
Host: www_googleapis_com
User-Agent: rclone_v1.39-161-gafc963ed
Authorization: XXXX
Accept-Encoding: gzip

2018_02_20 13:22:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:53 DEBUG : HTTP RESPONSE (req 0x13d4a300)
2018_02_20 13:22:53 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application_json; charset=UTF-8
Date: Tue, 20 Feb 2018 12:22:56 GMT
Expires: Tue, 20 Feb 2018 12:22:56 GMT
Server: GSE
Vary: Origin
Vary: X-Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

4c0
{
“exportFormats”: {
“application_vnd.google-apps.document”: [
“application_rtf”,
“application_vnd.oasis.opendocument.text”,
“text_html”,
“application_pdf”,
“application_epub+zip”,
“application_zip”,
“application_vnd.openxmlformats-officedocument.wordprocessingml.document”,
“text_plain”
],
“application_vnd.google-apps.spreadsheet”: [
“application_x-vnd.oasis.opendocument.spreadsheet”,
“text_tab-separated-values”,
“application_pdf”,
“application_vnd.openxmlformats-officedocument.spreadsheetml.sheet”,
“text_csv”,
“application_zip”,
“application_vnd.oasis.opendocument.spreadsheet”
],
“application_vnd.google-apps.jam”: [
“application_pdf”
],
“application_vnd.google-apps.script”: [
“application_vnd.google-apps.script+json”
],
“application_vnd.google-apps.presentation”: [
“application_vnd.oasis.opendocument.presentation”,
“application_pdf”,
“application_vnd.openxmlformats-officedocument.presentationml.presentation”,
“text_plain”
],
“application_vnd.google-apps.form”: [
“application_zip”
],
“application_vnd.google-apps.drawing”: [
“image_svg+xml”,
“image_png”,
“application_pdf”,
“image_jpeg”
]
}
}

0

2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-1 Doc in root of test01 - file owner test01.docx
2018_02_20 13:22:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:53 DEBUG : HTTP REQUEST (req 0x13dd8100)
2018_02_20 13:22:53 DEBUG : GET _drive_v3_files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cowners%29%2CnextPageToken&pageSize=1000&q=trashed%3Dfalse+and+%271EuLtoxkP6OETcCdoVNnbbqGVKFPkyilZ%27+in+parents HTTP_1.1
Host: www_googleapis_com
User-Agent: rclone_v1.39-161-gafc963ed
Authorization: XXXX
Accept-Encoding: gzip

2018_02_20 13:22:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:22:53 DEBUG : HTTP RESPONSE (req 0x13dd8100)
2018_02_20 13:22:53 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application_json; charset=UTF-8
Date: Tue, 20 Feb 2018 12:22:57 GMT
Expires: Tue, 20 Feb 2018 12:22:57 GMT
Server: GSE
Vary: Origin
Vary: X-Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

42d
{
“files”: [
{
“id”: “1VAyEnL6Lu70cFh6MIF_MQPWTenJGcKaaHZTUqWm7fp4”,
“name”: “Sheet in shared folder tester01 (owned by test01) - file owner test02”,
“mimeType”: “application_vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-20T12:21:07.798Z”,
“modifiedTime”: “2018-02-20T12:21:23.144Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test2”,
“me”: false,
“permissionId”: “12821402456939511812”,
“emailAddress”: “test2@…”
}
]
},
{
“id”: “19Fj5bKYQPWtS6dxOr-nt7_GirVgfQiVG8v74DvFtVhs”,
“name”: “Sheet in shared folder tester01 (owned by test01) - file owner test01”,
“mimeType”: “application_vnd.google-apps.spreadsheet”,
“trashed”: false,
“createdTime”: “2018-02-19T02:03:08.687Z”,
“modifiedTime”: “2018-02-20T12:20:48.020Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: true,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
}
]
}

0

2018_02_20 13:22:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-1 tester01_Sheet in shared folder tester01 (owned by test01) - file owner test01.xlsx
2018_02_20 13:22:53 DEBUG : Go routines at exit 6
2018_02_20 13:22:53 DEBUG : rclone: Version “v1.39-161-gafc963ed” finishing with parameters [“rclone” “-vv” “–drive-auth-owner-only” “–dump-bodies” “ls” “User_Drives:” “–drive-impersonate=test1@…”]

C:\rclone>

===================================================================================================================================

C:\rclone>rclone ls User_Drives: --drive-impersonate=test2@… --drive-auth-owner-only
-1 Doc in root of test02 - file owner test02.docx

C:\rclone>

===

C:\rclone>rclone -vv --drive-auth-owner-only --dump-bodies ls User_Drives: --drive-impersonate=test2@…
2018_02_20 13:23:12 NOTICE: --dump-bodies is obsolete - please use --dump bodies instead
2018_02_20 13:23:12 DEBUG : Using config file from “c:\…\rclone.conf”
2018_02_20 13:23:12 DEBUG : rclone: Version “v1.39-161-gafc963ed” starting with parameters [“rclone” “-vv” “–drive-auth-owner-only” “–dump-bodies” “ls” “User_Drives:” “–drive-impersonate=test2@…”]
2018_02_20 13:23:12 INFO : Google drive root ‘’: Modify window is 1ms
2018_02_20 13:23:12 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:12 DEBUG : HTTP REQUEST (req 0x13c8e080)
2018_02_20 13:23:12 DEBUG : POST _o_oauth2_token HTTP_1.1
Host: accounts.google.com
User-Agent: rclone_v1.39-161-gafc963ed
Content-Length: 859
Content-Type: application_x-www-form-urlencoded
Accept-Encoding: gzip

assertion=…
2018_02_20 13:23:12 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:12 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:23:12 DEBUG : HTTP RESPONSE (req 0x13c8e080)
2018_02_20 13:23:12 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Disposition: attachment; filename=“json.txt”; filename*=UTF-8’'json.txt
Content-Type: application_json; charset=utf-8
Date: Tue, 20 Feb 2018 12:23:16 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: ESF
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

f8
{
“access_token” : “…”,
“expires_in” : 3600,
“token_type” : “Bearer”
}
0

2018_02_20 13:23:12 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:23:12 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:12 DEBUG : HTTP REQUEST (req 0x13cc6100)
2018_02_20 13:23:12 DEBUG : GET _drive_v3_files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cowners%29%2CnextPageToken&pageSize=1000&q=trashed%3Dfalse+and+%27root%27+in+parents HTTP_1.1
Host: www_googleapis_com
User-Agent: rclone_v1.39-161-gafc963ed
Authorization: XXXX
Accept-Encoding: gzip

2018_02_20 13:23:12 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:23:13 DEBUG : HTTP RESPONSE (req 0x13cc6100)
2018_02_20 13:23:13 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application_json; charset=UTF-8
Date: Tue, 20 Feb 2018 12:23:16 GMT
Expires: Tue, 20 Feb 2018 12:23:16 GMT
Server: GSE
Vary: Origin
Vary: X-Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

3c1
{
“files”: [
{
“id”: “1_PAMSISfjtJf2gJzdfteRZG8OWOEY5pZ387Oz4Re0Qs”,
“name”: “Doc in root of test02 - file owner test02”,
“mimeType”: “application_vnd.google-apps.document”,
“trashed”: false,
“createdTime”: “2018-02-20T12:20:07.877Z”,
“modifiedTime”: “2018-02-20T12:20:19.663Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test2”,
“me”: true,
“permissionId”: “12821402456939511812”,
“emailAddress”: “test2@…”
}
]
},
{
“id”: “1EuLtoxkP6OETcCdoVNnbbqGVKFPkyilZ”,
“name”: “tester01”,
“mimeType”: “application_vnd.google-apps.folder”,
“trashed”: false,
“createdTime”: “2018-02-19T02:03:00.004Z”,
“modifiedTime”: “2018-02-20T12:19:47.042Z”,
“owners”: [
{
“kind”: “drive#user”,
“displayName”: “test1”,
“me”: false,
“permissionId”: “15101930270770955733”,
“emailAddress”: “test1@…”
}
]
}
]
}

0

2018_02_20 13:23:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:23:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:13 DEBUG : HTTP REQUEST (req 0x13c8e300)
2018_02_20 13:23:13 DEBUG : GET _drive_v3_about?alt=json&fields=exportFormats HTTP_1.1
Host: www_googleapis_com
User-Agent: rclone_v1.39-161-gafc963ed
Authorization: XXXX
Accept-Encoding: gzip

2018_02_20 13:23:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2018_02_20 13:23:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2018_02_20 13:23:13 DEBUG : HTTP RESPONSE (req 0x13c8e300)
2018_02_20 13:23:13 DEBUG : HTTP_1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v=“41,39,38,37,35”
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application_json; charset=UTF-8
Date: Tue, 20 Feb 2018 12:23:16 GMT
Expires: Tue, 20 Feb 2018 12:23:16 GMT
Server: GSE
Vary: Origin
Vary: X-Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

4c0
{
“exportFormats”: {
“application_vnd.google-apps.document”: [
“application_rtf”,
“application_vnd.oasis.opendocument.text”,
“text_html”,
“application_pdf”,
“application_epub+zip”,
“application_zip”,
“application_vnd.openxmlformats-officedocument.wordprocessingml.document”,
“text_plain”
],
“application_vnd.google-apps.spreadsheet”: [
“application_x-vnd.oasis.opendocument.spreadsheet”,
“text_tab-separated-values”,
“application_pdf”,
“application_vnd.openxmlformats-officedocument.spreadsheetml.sheet”,
“text_csv”,
“application_zip”,
“application_vnd.oasis.opendocument.spreadsheet”
],
“application_vnd.google-apps.jam”: [
“application_pdf”
],
“application_vnd.google-apps.script”: [
“application_vnd.google-apps.script+json”
],
“application_vnd.google-apps.presentation”: [
“application_vnd.oasis.opendocument.presentation”,
“application_pdf”,
“application_vnd.openxmlformats-officedocument.presentationml.presentation”,
“text_plain”
],
“application_vnd.google-apps.form”: [
“application_zip”
],
“application_vnd.google-apps.drawing”: [
“image_svg+xml”,
“image_png”,
“application_pdf”,
“image_jpeg”
]
}
}

0

2018_02_20 13:23:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-1 Doc in root of test02 - file owner test02.docx
2018_02_20 13:23:13 DEBUG : Go routines at exit 6
2018_02_20 13:23:13 DEBUG : rclone: Version “v1.39-161-gafc963ed” finishing with parameters [“rclone” “-vv” “–drive-auth-owner-only” “–dump-bodies” “ls” “User_Drives:” “–drive-impersonate=test2@…”]

C:\rclone>

OK, quite a lot of stuff… Had to replace some / and others with _ due to error “too many links” while pasting the text here.

And maybe this helps:

Thanks for that :slight_smile:

What it looks like to me is that when you use the --drive-impersonate user@... flag then drive is taking that user as the authenticated user so when you supply –drive-auth-owner-only you only get files owned by that user.

Is that what you expected?

It would be possible to add another flag to rclone --drive-owner user@gmail.com which only shows files owned by that email address. Would that help?

Thanks for your quick response! I’m not sure if I understood everything right. What I would expect:

–drive-impersonate test01@…
=> Download all files owned by test01 according to the upper half of the screenshot, no matter in which folder (own or shared by another user) they are stored.

–drive-impersonate test02@…
=> Download all files owned by test02 according to the bottom half of the screenshot, no matter in which folder (own or shared by another user) they are stored.

In this example, the folder tester01 belongs to test01 and is also downloaded by that user with his file in it. But this folder should also be created while downloading the files of test02 with only the file in it belonging to test02.

Is this would you propose with the additional flag? Then YES :slight_smile:

I think I see what the problem is now… when using user test02 rclone is skipping the tester01 folder completely because it isn’t owned by test02 - is that correct?

Does this fix the problem for you?

https://pub.rclone.org/v1.39-170-g3e9d8967-drive-auth-ownerβ/

1 Like

:grinning: :+1:

Simply perfect! Now it works great. THANK YOU!

Great :slight_smile: I’ll merge that into master in a bit!

I forgot to merge this into master, but have now! See

https://beta.rclone.org/v1.39-175-g25bbc5d2/ (uploaded in 15-30 mins)

And subsequent betas!