Giter Club home page Giter Club logo

google-drive-and-python's Introduction

Google Drive Downloader

A python scripts that uses Google Drive API to download folders or files.

Demo

demo

Installation

  1. Git clone this repo:
git clone https://github.com/Techyhans/google-api-scraping.git
  1. Create an Python 3.8.5 >= environment:
conda create -n gdrive-api python=3.10.9
conda activate gdrive-api
  1. Install required dependencies:
pip install -r requirements.txt

Get client_secret.json from Google API

Open Google Console and write Google Drive API to search bar. Click Create Credentials / OAuth Client ID then create your project. After download your client_secretXXX.json file and save it as "client_secret.json"

Download using Google Drive API

You may state two arguments to run the download.py.

  • '-l' or '--link': One or more files or folders sharable link you would like to download (Must be given)
  • '-i' or '--id': One or more files or folders ID you would like to download (Must be given)
  • '-n' or '--name': One or more folder names you would like to search and download in given parent folder ID (Optional)."

For example:

CASE 1: Download folders or files with their sharable links

  • To download a folder with all items it contains, specifying its sharable links as below:
python download.py -l https://drive.google.com/file/d/1ZKWjVjYAgjKbLYviQFCwT0HfuDwGweCq/view?usp=share_link
  • To download multiple folders:
python download.py -i DRIVE_LINK1 DRIVE_LINK2 ...
  • If you want to download a file only. Also, you only have to provide the ID.

CASE 2: Download specifically named folders with the given parent folder sharable link

  • To search folder with folder name folder_1 under the parent folder with given ID:
python download.py -i DRIVE_LINK -n folder_1

This would only download the folder_1 folder with all its content. You may specific multiple IDs and names.

Authors

google-drive-and-python's People

Contributors

egemengulpinar avatar hansheng0512 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.