Sorry about not including any code.
I'm using this gist that has worked with another script for several years. In that script, I upload a plist file to dropbox. I use it a couple times a week and it works without a hitch.
But this new script, that downloads a text file, isn't working at all and gives me the errors mentioned in the first post. And, weirdly, the comments on that gist indicate the same errors for those users. Yet, this code has worked for me with my other script.
Here is my code that calls that gist dropbox login code:
import dropboxloginv2 as dropboxlogin
import console
from dropbox import rest
dropboxlogin.app_key = '...' #with my app_key
dropboxlogin.app_secret = '...' #with my app_secret
DBX = dropboxlogin.get_client()
AUTOTAG_PATH = '/github/scripts/python/autotag_hints.txt'
def get_hints():
try:
md, res = DBX.files_download(AUTOTAG_PATH)
except rest.ErrorResponse as e:
console.alert('Error opening hints file', message='{}\n'.format(e))
return None
data = res.content
for line in data:
(ptn, tags) = line.split(' :: ')
hints[ptn] = tags.split(' ')
return hints
def main():
autotag_hints = get_hints()
print(autotag_hints)
if __name__ == '__main__':
main()
I tried moving the line DBX = dropboxlogin.get_client()
inside the try
block of get_hints()
and got a different error: Error opening hints file [401] 'Invalid signature.'