Kodi Community Forum

Full Version: Getting the plugin userdata path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Each plugin have a dedicated directory for it's own data for the user profile, usually (in Winodws, but in similar places in other OSs): %AppData%/XBMC/userdata/addon/plugin.name.here/
How do I get this path to store my file in a cross-platform way (won't break if I change system). It would be great if the path is under to the userdata of the current profile (or the master profile if it is the current one)

Thanks
PHP Code:
__addon__       xbmcaddon.Addon(id='script.artwork.downloader')
__addondir__    xbmc.translatePath__addon__.getAddonInfo('profile') ) 
Thanks, you are the greatest!
No problem. Those are the easy questions Wink

Feel free to ask more if you need some help
Thanks! Easy but essential for new developers Smile
(2012-03-08, 20:53)Martijn Wrote: [ -> ] 
PHP Code:
__addon__ xbmcaddon.Addon(id='script.artwork.downloader')
__addondir__ xbmc.translatePath__addon__.getAddonInfo('profile') ) 

I'm a kodi dev noob, but how are xbmc and xbmcaddon imported?
(2019-08-09, 00:16)PoolloverNathan Wrote: [ -> ]
(2012-03-08, 20:53)Martijn Wrote: [ -> ]
PHP Code:
__addon__ xbmcaddon.Addon(id='script.artwork.downloader')
__addondir__ xbmc.translatePath__addon__.getAddonInfo('profile') ) 

I'm a kodi dev noob, but how are xbmc and xbmcaddon imported? 
Hacked lambda scrapers, found out that they're toplevel modules. Nevermind.