Git Product home page Git Product logo

google-drive-folder-downloader's Introduction

Google public folder downloader

Downloads a publicly shared Google Drive folder as a Zip bundle.

Overview

Runs a Cypress test specification to automate the browser to perform the following steps.

  • Visit the Google Drive shared folder page.
  • Click the Download all link and wait for Google Drive to prepare the Zip file link.
  • Downloads and tracks the progress of the file download(s), stops after the file(s) have downloaded.

Note:

For big folders, Google Drive prepares multiple Zip files. This service downloads all of them.

Usage

Workflow is Docker based, so either utilize the full image prepared by the Cypress team (convenient, but big image) or build a custom image, usign the provided Dockerfile and execute it (smaller image size).

The service requires the Google Drive folder Id. The folder Id is part of the shared URL. E.g.

Shared URL: https://drive.google.com/drive/folders/28sjdTTTjsvsz1TTKdfasd?usp=sharing
Folder Id -> 28sjdTTTjsvsz1TTKdfasd

Also, an optional variable max_download_time_seconds, can be passed to increase the total run time beyond the default 30 mins, if downloading big files on a slow network. The service ends as soon as the download is complete OR terminates if this max time limit is reached (default: 30 mins).

Single command Docker run

A convenient option is to utilize the full bundled image prepared by the Cypress team, with Cypress and browsers pre-installed. The image is available on Docker Hub. The image size is 1.5 - 2 GB.

Executing the following from project root, should download and place the Zip file(s) in the cypress/downloads folder.

$ docker run --rm \
    -v $(pwd):/e2e \
    -w /e2e \
    -e CYPRESS_drive_folder_id=XXX \
    -e CYPRESS_max_download_time_secs=1800 \
    cypress/included

Application container

A Dockerfile is included in the project to build a container image. This build installs no browsers, but utilizes Electron. The following command can be used to build the image.

$ docker build -t localhost/google-drive-dwnldr .

And the built image can then be executed as follows. Remember to mount the folder where you want the Zip file downloaded.

$ docker run --rm \
    -v $(pwd)/cypress/downloads:/app/cypress/downloads \
    localhost/google-drive-dwnldr run --env drive_folder_id=28sjdTTTjsvsz1TTKdfasd

google-drive-folder-downloader's People

Contributors

mohnish82 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.