Closed porg closed 11 months ago
I've also moved the APP_KEY and ACCOUNT_TYPE variables into the config file to simplify upgrading.
👍 Per se great! 👉 But it yet misses documentation. Please amend!
The README.md
does not mention the config file ~/.get_dropbox_link_conf.json
at all.
The following should be addressed there:
In particular please describe the "upgrade path" for users like me, whose ~/.get_dropbox_link_conf.json
until before the recent Dropbox New Link API adaptations (after 2023-08-09) was like:
{"refresh_token": "XXX", "access_token": "YYY", "access_token_expiration": "YYYY-MM-DDThh:mm:ss.nnnnnn"}
Intermediary update:
After updating the script file, invoking your hotkey, which invoked Automator, which invokes the script fails, as the script needs to re-configure its config file.
Go to Terminal and invoke get_dropbox_link.py
and it will guide you through it
$ get_dropbox_link.py ~/Dropbox/Public/some-file.png
=>Please provide your app's App Key. This is NOT an OAuth2 token.
Find the App Key in the App Console. See the README.
App Key: ••••••••••••••••••••••••
=> Which kind of Dropbox account is this App Key associated with?
[p]ersonal or [b]usiness? p
https://www.dropbox.com/s/xxxxxxxx/some-file.png?dl=0
After this ~/.get_dropbox_link_conf.json
will have changed to this:
{"app_key": "XXX",
"refresh_token": "XXX",
"account_type": "PERSONAL",
"access_token": "XXX", // Note: Changed when script re-configured now.
"access_token_expiration": "YYYY-MM-DDThh:mm:ss.nnnnnn8" // Note: Changed to timestamp of re-configuration.
}
Precondition
You already had get_dropbox_link.py installed and had ran the initialization:
APP_KEY =
in the script fileget_dropbox_link.py
~/.get_dropbox_link_conf.json
Problem
Now when you update a newer
get_dropbox_link.py
file over your old one, you have 2 problems:~/.get_dropbox_link_conf.json
gets not overwritten by the new app key, but instead remains untouched and hence remains the old one and hence there's a mismatch/contradiction.Proposed Improvements
get_dropbox_link.py
but elsewhere, e.g.get_dropbox_link_app_key.conf
~/.get_dropbox_link_conf.json
(I'm speculating, not knowing)get_dropbox_link.py
once on your system, but removed it, and later add it again, but you still have the credentials inget_dropbox_link_app_key.conf
, it's clever enough and just uses them.