2011-11-08, 01:44
ronie Wrote:cool, we're ready then ;-)
available in our repo as of now:
http://mirrors.xbmc.org/addons/eden-pre/...playlists/
Great! And many thanks.
ronie Wrote:cool, we're ready then ;-)
available in our repo as of now:
http://mirrors.xbmc.org/addons/eden-pre/...playlists/
(2012-03-16, 14:29)union1mc Wrote: I've been getting 'script failed' messages when trying to add them to the aeon nox skin. Posted my logs there, but was told I might get better help here as I guess this is a problem with the script. I'm basically unable to add any playlists to the menu because of this. Here's the log:
http://pastebin.com/ExvCH8Aj
Thanks for any help you can give me
(2012-03-16, 14:38)The_Dogg Wrote: I'm using path substitution in advancedsettings.xml for the playlist folder location. I have a problem where when using the script to retreive the playlist (using aeon nox) it looks in the local folder instead of using path substitution location (which is a smb share on another computer)
Is it possible that the script uses the path substitution if present in advancedsettings.xml?
Thanks
<pathsubstitution>
<substitute>
<from>special://profile/playlists/video/</from>
<to>smb://computer/share/playlists/video/</to>
</substitute>
</pathsubstitution>
(2012-03-16, 19:50)ronie Wrote:(2012-03-16, 14:29)union1mc Wrote: I've been getting 'script failed' messages when trying to add them to the aeon nox skin. Posted my logs there, but was told I might get better help here as I guess this is a problem with the script. I'm basically unable to add any playlists to the menu because of this. Here's the log:
http://pastebin.com/ExvCH8Aj
Thanks for any help you can give me
according to the error, one of your playlists contains invalid xml.
did you manually create them?
the safest way would be to use the smart playlist editor in xbmc to create playlists.
(2012-03-16, 14:38)The_Dogg Wrote: I'm using path substitution in advancedsettings.xml for the playlist folder location. I have a problem where when using the script to retreive the playlist (using aeon nox) it looks in the local folder instead of using path substitution location (which is a smb share on another computer)
Is it possible that the script uses the path substitution if present in advancedsettings.xml?
Thanks
i'm not entirely sure if xbmc also applies the pathsubstitution rules to addons.
mind testing if this rule works:
Code:<pathsubstitution>
<substitute>
<from>special://profile/playlists/video/</from>
<to>smb://computer/share/playlists/video/</to>
</substitute>
</pathsubstitution>
<substitute>
<from>special://masterprofile/playlists/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/</to>
</substitute>
00:19:56 T:7096 DEBUG: Thread XBPyThread start, auto delete: 0
00:19:56 T:7096 DEBUG: Python thread: start processing
00:19:56 T:7096 NOTICE: -->Python Interpreter Initialized<--
00:19:56 T:7096 DEBUG: XBPyThread::Process - The source file to load is C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists\default.py
00:19:56 T:7096 DEBUG: XBPyThread::Process - Setting the Python path to C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists;C:\Program Files (x86)\XBMC\addons\script.module.simplejson\lib;C:\Users\<username>\AppData\Roaming\XBMC\addons\script.module.beautifulsoup\lib;C:\Program Files (x86)\XBMC\addons\script.module.pil\lib;C:\Users\<username>\AppData\Roaming\XBMC\addons\script.module.elementtree\lib;C:\Program Files (x86)\XBMC\addons\script.module.pysqlite\lib;C:\Program Files (x86)\XBMC\system\python\DLLs;C:\Program Files (x86)\XBMC\system\python\Lib;C:\Program Files (x86)\XBMC\python26.zip;C:\Program Files (x86)\XBMC\system\python\lib\plat-win;C:\Program Files (x86)\XBMC\system\python\lib\lib-tk;C:\Program Files (x86)\XBMC;C:\Program Files (x86)\XBMC\system\python;C:\Program Files (x86)\XBMC\system\python\lib\site-packages;
00:19:56 T:7096 DEBUG: XBPyThread::Process - Entering source directory C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists
00:19:56 T:7096 DEBUG: Instantiating addon using automatically obtained id of "script.playlists" dependent on version 2.0 of the xbmc.python api
00:19:56 T:7096 DEBUG: script.playlists: script version 0.1.0 started
00:19:56 T:7096 DEBUG: script.playlists: params: {'type': 'video'}
00:19:56 T:7096 INFO: -->Python script returned the following error<--
00:19:56 T:7096 ERROR: Error Type: <type 'exceptions.WindowsError'>
00:19:56 T:7096 ERROR: Error Contents: (3, 'The system cannot find the path specified', 'C:\\Users\\<username>\\AppData\\Roaming\\XBMC\\userdata\\playlists\\video\\*.*')
00:19:56 T:7096 ERROR: Traceback (most recent call last):
File "C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists\default.py", line 71, in <module>
Main()
File "C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists\default.py", line 18, in __init__
self._fetch_playlists()
File "C:\Users\<username>\AppData\Roaming\XBMC\addons\script.playlists\default.py", line 45, in _fetch_playlists
dirlist = os.listdir( xbmc.translatePath( path ) )
WindowsError: (3, 'The system cannot find the path specified', 'C:\\Users\\<username>\\AppData\\Roaming\\XBMC\\userdata\\playlists\\video\\*.*')
00:19:56 T:7096 INFO: -->End of Python script error report<--
00:19:56 T:7096 INFO: Python script stopped
00:19:56 T:7096 DEBUG: Thread XBPyThread 7096 terminating
<substitute>
<from>special://masterprofile/playlists/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/</to>
</substitute>
<substitute>
<from>special://profile/playlists/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/</to>
</substitute>
<substitute>
<from>special://masterprofile/playlists/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/</to>
</substitute>
<substitute>
<from>special://profile/playlists/video/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/video/</to>
</substitute>
<substitute>
<from>special://profile/playlists/video/</from>
<to>smb://192.168.0.100/xbmc/userdata/playlists/video/</to>
</substitute>
(2012-03-24, 18:21)kaburke Wrote: One workaround would be for the script to look at advancedsettings.xml and perform the substitutions itself. I'm not familliar with python, but I'll try to take a look at the script later today.
(2012-03-24, 18:37)ronie Wrote:(2012-03-24, 18:21)kaburke Wrote: One workaround would be for the script to look at advancedsettings.xml and perform the substitutions itself. I'm not familliar with python, but I'll try to take a look at the script later today.
even if path substitution would work, the script will most probably fail on the next step,
ie. listing the contents of the directory.
afaik there's no way to do this from python on smb shares.
def getDirList(path):
dirList = []
currentLevelDirList = [path]
while True:
prevLevelDirList = []
if len(currentLevelDirList) > 0:
for dirName in currentLevelDirList:
prevLevelDirList.append(dirName)
dirList.append(dirName)
currentLevelDirList = []
else:
break
for dirName in prevLevelDirList:
log('Checking for directories in: %s' % dirName)
json_response = xbmc.executeJSONRPC('{ "jsonrpc" : "2.0" , "method" : "Files.GetDirectory" , "params" : { "directory" : "%s" , "sort" : { "method" : "file" } } , "id" : 1 }' % dirName.encode('utf-8').replace('\\', '\\\\'))
jsonobject = simplejson.loads(json_response)
if jsonobject['result']['files']:
for item in jsonobject['result']['files']:
if item['filetype'] == 'directory':
currentLevelDirList.append(item['file'])
return dirList
def getFileList(path):
fileList = []
dirList = getDirList(path)
for dirName in dirList:
log('Checking for files in: %s' % dirName)
json_response = xbmc.executeJSONRPC('{ "jsonrpc" : "2.0" , "method" : "Files.GetDirectory" , "params" : { "directory" : "%s" , "sort" : { "method" : "file" } , "media" : "video" } , "id" : 1 }' % dirName.encode('utf-8').replace('\\', '\\\\'))
jsonobject = simplejson.loads(json_response)
if jsonobject['result']['files']:
for item in jsonobject['result']['files']:
if item['filetype'] == 'file':
fileList.append(item['file'])
log('Found video: %s' % item['file'])
return fileList
(2012-03-28, 20:22)paddycarey Wrote:nice, it never crossed my mind to use json for listing dirs.(2012-03-24, 18:37)ronie Wrote:(2012-03-24, 18:21)kaburke Wrote: One workaround would be for the script to look at advancedsettings.xml and perform the substitutions itself. I'm not familliar with python, but I'll try to take a look at the script later today.
even if path substitution would work, the script will most probably fail on the next step,
ie. listing the contents of the directory.
afaik there's no way to do this from python on smb shares.
I wrote a couple of little functions for my mmabrowser addon which work as sort of a replacement for os.walk and support (afaik) any local or remote share type that xbmc understands.
Maybe they'd be useful for you in this case?
(2013-02-11, 18:38)mikebzh44 Wrote: Work fine for me with smart playlist named Animés and filename Animés.xsp.
Tested on Windows XP SP3.
Thanks Ronie.
RunScript(script.playlists,type=music)