robweber / xbmcbackup

Backup Addon for Kodi
MIT License
113 stars 48 forks source link

Dropbox - TypeError: 'NoneType' object is not callable #243

Open ven0ms99 opened 1 month ago

ven0ms99 commented 1 month ago

Can't start backup while Dropbox as a remote location is enabled, because an exception is thrown:

2024-10-08 15:54:49.502 T:5753    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'TypeError'>
                                                   Error Contents: 'NoneType' object is not callable
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 102, in <module>
                                                       backup = XbmcBackup()
                                                                ^^^^^^^^^^^^
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 55, in __init__
                                                       self.configureRemote()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 65, in configureRemote
                                                       self.remote_vfs = DropboxFileSystem("/")
                                                                         ^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/vfs.py", line 144, in __init__
                                                       if(authorizer.isAuthorized()):
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/authorizers.py", line 62, in isAuthorized
                                                       user_token = self._getToken()
                                                                    ^^^^^^^^^^^^^^^^
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/authorizers.py", line 148, in _getToken
                                                       result['expiration'] = datetime.strptime(result['expiration'], "%Y-%m-%d %H:%M:%S.%f")
                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   TypeError: 'NoneType' object is not callable
                                                   -->End of Python script error report<--
robweber commented 1 month ago

Usually one of two things is happening with this type of error.

  1. You haven't authorized the Dropbox service, so no token file exists. Take a look at the instructions if you think this is the issue.
  2. The file is missing or corrupt for some other reason. Try deleting the tokens.json file and re-authorizing.