This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Put the ID of the folder you want to process | |
| // https://drive.google.com/drive/folders/abcdefgh | |
| const id = "abcdefgh"; | |
| // we will store file names in this dictionary. | |
| // using Set could be more efficient to check if it contains file (time complexity: O(1)) | |
| // App Script does not support Set | |
| const allFiles = []; | |
| // Keep deleted file URLs and report in the end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let isInProgress = true; | |
| const PAGE_DURATION = 90000; // as milliseconds | |
| const BUTTON_TITLE = "Next Page"; | |
| const getElement = selector => document.querySelector(selector); | |
| setInterval(() => { | |
| if (isInProgress && getElement(`[title="${BUTTON_TITLE}"]`)) { | |
| isInProgress = false; | |
| setTimeout(() => { | |
| getElement(`[title="${BUTTON_TITLE}"]`).click(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gzip | |
| import shutil | |
| import hashlib | |
| import os | |
| original_file = "file/path" | |
| zipped_file = "file/path" | |
| unzipped_file = "file/path" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * ============================================================================= | |
| * Google Drive: Unshare, Copy & Reclaim Ownership | |
| * ============================================================================= | |
| * | |
| * PURPOSE: | |
| * Processes a shared Google Drive folder tree and: | |
| * 1. Removes all sharing permissions from files/folders you own. | |
| * 2. Copies files you don't own into folders you do own, then removes | |
| * the shared originals from your view. |