Kodi Community Forum
Getting the plugin userdata path - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Getting the plugin userdata path (/showthread.php?tid=125068)



Getting the plugin userdata path - tria - 2012-03-08

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


- Martijn - 2012-03-08

PHP Code:
__addon__       xbmcaddon.Addon(id='script.artwork.downloader')
__addondir__    xbmc.translatePath__addon__.getAddonInfo('profile') ) 



- tria - 2012-03-08

Thanks, you are the greatest!


- Martijn - 2012-03-08

No problem. Those are the easy questions Wink

Feel free to ask more if you need some help


RE: Getting the plugin userdata path - harrygg - 2015-10-01

Thanks! Easy but essential for new developers Smile


RE: Getting the plugin userdata path - PoolloverNathan - 2019-08-09

(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?


RE: Getting the plugin userdata path - PoolloverNathan - 2019-08-09

(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.