script.toolbox
script.toolbox copied to clipboard
Kodi Nexus v20 on TvOS - Error: module 'xbmc' has no attribute 'translatePath'
Testing Kodi Nexus v20 Alpha on Apple TV 4K (2021) and script.toolbox does not work. It causes the error shown below from log. I found a similar sounding issue here that may help: https://forum.libreelec.tv/thread/24883-official-francetv-add-on-bug-in-le11-nightly-attributeerror-module-xbmc-has-no-a/.
If you think this actually an issue with the Kodi Alpha, please let me know so I can open this issue there for the Kodi devs. Thanks.
2022-06-18 08:19:56.440 T:2349185 ERROR
xbmc.TranslatedPath was fully deprecated in v20. xbmcvfs.TranslatePath should be used instead.
https://github.com/jojobrogess/script.toolbox/commits/master
I made this for myself a little while back so that I could get it to work. I'm pretty sure phil65 has retired from the kodi scene.
Thanks, but this doesn't seem to install on Nexus since it depends on Python 2.1. My issue is specifically with Nexus, which runs on Python 3.
I literally just installed tool.box without needing to do this but:
Inside addon.xml, you'll see:
<addon id="script.toolbox" name="ToolBox Script" version="1.1.3" provider-name="phil65">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
<import addon="script.module.pil" version="1.1.7"/>
Where it says: <import addon="xbmc.python" version="2.1.0"/> change it to <import addon="xbmc.python" version="3.0.0"/>
I just made the change on my repo, it should work now. https://github.com/jojobrogess/script.toolbox
LMK
EDIT script.toolbox\resources\lib\Utils.py and ADD this:
try:
translatePath = xbmcvfs.translatePath
except:
translatePath = xbmc.translatePath
Right below:
import xbmc
import xbmcaddon
import xbmcgui
import xbmcvfs
import os
import json
import hashlib
import urllib
from PIL import Image, ImageOps
from resources.lib.ImageOperations import MyGaussianBlur
from xml.dom.minidom import parse
Then CHANGE the ADDON_DATA_PATH = to:
ADDON_DATA_PATH = os.path.join(translatePath("special://profile/addon_data/%s" % ADDON_ID))