Hello,
I am making a python script that downloads all the files in a Apps folder that I set up for this specific reason. The script is ment to keep me and my friends updated in our workflow. However, after a while, the App token expired and we lost access to the folder; with a bit of research I found out that Dropbox is no longer using permanent tokens and migrated to short-lived tokens and a optional refresh token w/ oauth2.
I am very confused on how to keep the connection alive and from the tutorials that I've watched on YouTube, it looks way to complicated for a simple script, because of this I am even considering changing services and trying to find a easier option. I've never worked with oauth2 before if you haven't guessed already, do I really need to authenticate every time to get the token? I really don't want 50% of my code being just the auth process.
That's lliterally what I was using to connect to DB with the short-lived token:
def getDropbox():
dbx_token = open(os.path.join(path_config,"dropbox_token.txt"),"r").read()
return dropbox.Dropbox(dbx_token)
I know there are security risks involved in a permanent token but this is just a quick fix for something that doesn't need to be that secured. I just wanted that my script could always download that files everytime without having to manually generate a new token.
Thank you if you have the time to answer. Also, sorry for any English/code knowledge mistakes, I just program for fun = )
- Rafael