# Dropbox Transfer → local folder → Google Drive

Use when the user shares a Dropbox Transfer link and asks to save its contents locally and under a Google Drive folder.

## Proven workflow

1. Open the Dropbox Transfer link in the browser, not plain `requests`, because the transfer page is dynamic and the download endpoint is created client-side.
2. Dismiss/decline the cookie banner if present.
3. Click **Alle herunterladen** / **Download all**.
4. If Dropbox shows a login/register modal, click **Oder nur mit Download fortfahren** / **continue with download only**.
5. Browser downloads usually land in `/home/agent/Downloads/Transfer.zip`.
6. Verify the ZIP before extracting:
   - inspect entry count and names with Python `zipfile`
   - confirm the top-level folders match the Dropbox listing
7. Extract to the requested local destination.
8. For Google Drive with `gog`:
   - resolve the target folder IDs with `gog -a <account> drive search ... -j --results-only`
   - create missing folders with `gog drive mkdir <name> --parent=<parentId>`
   - upload each file with `gog drive upload <path> --parent=<folderId>`
   - preserve the source directory tree by creating folder IDs depth-first.
9. Verification: recursively list Drive children and compare local vs Drive file count, folder count, and byte totals.

## Important pitfall

`gog drive search` defaults to a small result page (observed 20). For recursive verification of uploaded folders, pass `--max 1000` or pagination will undercount Drive files and produce a false mismatch.

## Useful local summary pattern

Count local files/folders/bytes excluding transient upload logs, then compare with Drive metadata (`size` for binary files). Empty folders should also be created and counted on Drive.
