-
Notifications
You must be signed in to change notification settings - Fork 0
/
fiload.py
29 lines (22 loc) · 952 Bytes
/
fiload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python3
if __name__ == '__main__':
from dropbox import DropboxOAuth2FlowNoRedirect, Dropbox
import upload
import webbrowser
auth_flow = DropboxOAuth2FlowNoRedirect('lcuv078yjtdw8ys', '4f3vg9wgpc9cn4g')
#start the auth process
authorize_url = auth_flow.start()
print('1. Your browser will take you to the authorization webpage.')
#take the user to the authorization page
webbrowser.open(authorize_url)
print('2. Approve fiload so that it can access your account(you might have to log in first). '
'Then copy the authorization code.')
print('3. Copy the authorization code given.')
auth_code = input("4. Enter the code below: ", ).strip()
try:
oauth_result = auth_flow.finish(auth_code)
except Exception as exc:
print('Error: %s' % (exc,))
upload.backup(Dropbox(oauth_result.access_token))
import main
print('Uploading done!')