2025-12-21 16:56:48.033 T:14727 info <general>: [Amazon VOD] Export: The Last of Us - S02E150 - The Last of Us: Ellie's Journey to Season 2
2025-12-21 16:56:48.152 T:14727 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: fromisoformat: argument must be str
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/default.py", line 9, in <module>
EntryPoint(argv)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/startup.py", line 81, in EntryPoint
_g.pv.getPage(_g.watchlist, export=2)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/android_api.py", line 150, in getPage
addDir(k, 'getPage', page, opt=urlencode(v), export=export)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/itemlisting.py", line 50, in addDir
exec(f'_g.pv.{mode}("{url}", "{opt}", {page}, export={export})')
File "<string>", line 1, in <module>
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/android_api.py", line 257, in getPage
addDir(self.formatTitle(il), 'getPage', 'details', infoLabels=il, opt='itemId=' + il['asins'], cm=cm, page=pgnr, export=export)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/itemlisting.py", line 50, in addDir
exec(f'_g.pv.{mode}("{url}", "{opt}", {page}, export={export})')
File "<string>", line 1, in <module>
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/android_api.py", line 168, in getPage
addDir(self.formatTitle(il), 'getPage', 'details', il, 'itemId=' + il['asins'], cm=cm, export=export)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/itemlisting.py", line 50, in addDir
exec(f'_g.pv.{mode}("{url}", "{opt}", {page}, export={export})')
File "<string>", line 1, in <module>
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/android_api.py", line 174, in getPage
addVideo(self.formatTitle(il), il['asins'], il, cm=cm, export=export)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/itemlisting.py", line 117, in addVideo
Export(infoLabels, url)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.amazon-test/resources/lib/export.py", line 21, in Export
isAired = datetime.date.today() >= datetime.date.fromisoformat(infoLabels.get('premiered', '1970-01-01'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: fromisoformat: argument must be str
-->End of Python script error report<--
Trying to export certain titles fails with the exception above. This happens because the premiered field has a value of None; e.g. adding debugging at
{'plot': 'Bella ...', 'mpaa': None, 'cast': [], 'year': None, 'premiered': None, 'rating': None, 'votes': 0, 'isAdult': 0, 'director': None, 'genre': ['Drama', 'Fantasy', 'Sci-Fi/Fantasy'], 'studio': ['Discovery Global Drama'], 'thumb': 'https://... 'fanart': 'https://...', 'isHD': False, 'isUHD': False, 'audiochannels': 2, 'TrailerAvailable': False, 'asins': 'amzn1.dv.gti....', 'isPrime': False, 'title': 'The Last of Us: Character Featurette - Ellie', 'contentType': 'episode', 'mediatype': 'episode', 'tvshowtitle': 'The Last of Us', 'seriesasin': 'amzn1.dv.gti.....', 'totalseasons': 2, 'season': 2, 'duration': 49, 'episode': 153}
fixes it.
Addon used
Account type
System Setup (please provide the following information):
Upload Logs
Describe the bug
Trying to export certain titles fails with the exception above. This happens because the
premieredfield has a value ofNone; e.g. adding debugging athttps://github.com/Sandmann79/xbmc/blob/master/plugin.video.amazon-test/resources/lib/export.py#L21
shows that
infoLabelshas the content{'plot': 'Bella ...', 'mpaa': None, 'cast': [], 'year': None, 'premiered': None, 'rating': None, 'votes': 0, 'isAdult': 0, 'director': None, 'genre': ['Drama', 'Fantasy', 'Sci-Fi/Fantasy'], 'studio': ['Discovery Global Drama'], 'thumb': 'https://... 'fanart': 'https://...', 'isHD': False, 'isUHD': False, 'audiochannels': 2, 'TrailerAvailable': False, 'asins': 'amzn1.dv.gti....', 'isPrime': False, 'title': 'The Last of Us: Character Featurette - Ellie', 'contentType': 'episode', 'mediatype': 'episode', 'tvshowtitle': 'The Last of Us', 'seriesasin': 'amzn1.dv.gti.....', 'totalseasons': 2, 'season': 2, 'duration': 49, 'episode': 153}Writing
fixes it.