improve/create documentation
This commit is contained in:
parent
c44ffc4dfd
commit
95f331199b
2 changed files with 26 additions and 1 deletions
23
README.md
Normal file
23
README.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Download unseen files from a folder in Google Drive
|
||||||
|
Example:
|
||||||
|
~~~
|
||||||
|
cd ~/Documents
|
||||||
|
drive-download scanbot
|
||||||
|
~~~
|
||||||
|
|
||||||
|
The script only downloads files it hasn't seen before.
|
||||||
|
|
||||||
|
## Configuring
|
||||||
|
1. Get Google Drive API id and secret from the Google API console.
|
||||||
|
2. Create and edit `.config/drive-download/settings.yaml`:
|
||||||
|
|
||||||
|
~~~
|
||||||
|
client_config_backend: settings
|
||||||
|
client_config:
|
||||||
|
client_id: XXX.apps.googleusercontent.com
|
||||||
|
client_secret: _s3cr3deadc4fef00baR
|
||||||
|
|
||||||
|
save_credentials: True
|
||||||
|
save_credentials_backend: file
|
||||||
|
save_credentials_file: /home/USERNAME/.cache/drive-download/credentials.json
|
||||||
|
~~~
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
# Download unseen files from a folder in Google Drive
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
if sys.version_info < (3, 3):
|
if sys.version_info < (3, 3):
|
||||||
|
@ -39,7 +40,8 @@ def folder_id(folder_name):
|
||||||
def main():
|
def main():
|
||||||
global seen, drive
|
global seen, drive
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Download files from a folder in Google Drive')
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Download unseen files from a folder in Google Drive')
|
||||||
parser.add_argument('folder', type=str, help='folder to download from')
|
parser.add_argument('folder', type=str, help='folder to download from')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue