Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

How to send desktop files to drive? #207

Open
Jainu-s opened this issue Sep 20, 2020 · 1 comment
Open

How to send desktop files to drive? #207

Jainu-s opened this issue Sep 20, 2020 · 1 comment

Comments

@Jainu-s
Copy link

Jainu-s commented Sep 20, 2020

I have few csv files and I want to send to google drive how to send it and also if I want to automate this process from web so how to use yaml file.

@veyselolgun
Copy link

veyselolgun commented Oct 14, 2020

Hello, first of all you need to get client_secrets.json file from google. You can search how to get .json file
When i tried this code it worked you can try it. When you run this code, it will ask you verification code via command line, what you have to do is that go to the link from your browser and get the code and then paste it to command line. If no error your file will be uploaded to google drive. (Be carefull for security problem, because google say that "Unverified Apps" for Quickstart App)
(If you dont want to use command line, then you need to change CommandLineAuth() to LocalWebserverAuth())

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

gauth = GoogleAuth()
gauth.CommandLineAuth()

drive = GoogleDrive(gauth)
file  = drive.CreateFile()
file.SetContentFile("out000.mp3")
file.Upload()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants