[RELEASE] iTunes Playlist Importer Addon - Convert all iTunes Playlists to XBMC's M3U

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
moko Offline
Junior Member
Posts: 2
Joined: Mar 2011
Reputation: 0
Post: #11
will this work on ATV2?
find quote
simpic Offline
Junior Member
Posts: 42
Joined: May 2011
Reputation: 0
Post: #12
Hi,

I have the following setup...

NAS with the iTunes Library.xml and files on it.
Desktop which I use to run iTunes from and sync with my i devices.
HTPC running WIN7 and XBMC

Both the desktop and HTPC are setup with the Music share on the NAS mapped as X.

The iTunes Library.xml uses the following as it's path...

key>Music Folder</key><string>file://localhost/X:/iTunes%20Music/</string>

Should I enter the following into the options for the plugin?

Old path: file://localhost/X:/
New path: X:/

Then the million dollar question...

How do I run the script!!!

Thanks in advance for any help.
find quote
Dav59 Offline
Junior Member
Posts: 5
Joined: Oct 2010
Reputation: 0
Post: #13
the optional "old path" & "new path" are there if you want to change where music are.

if your songs are not located at "file://localhost/X:/iTunes%20Music/" you can change the location to the real path of your songs directory. (the script will search "old path" and will replace by "new path")
find quote
reddwarf355 Offline
Junior Member
Posts: 6
Joined: Aug 2011
Reputation: 0
Post: #14
Getting the following errors:


10:27:54 T:2958184448 DEBUG: WaitOnScriptResult - waiting on the iTunes Playlist Importer plugin...
10:27:54 T:2955980800 NOTICE: -->Python Interpreter Initialized<--
10:27:54 T:2955980800 DEBUG: Process - The source file to load is /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py
10:27:54 T:2955980800 DEBUG: Process - Setting the Python path to /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u:/Users/maurice/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/maurice/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pysqlite/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages:
10:27:54 T:2955980800 DEBUG: Process - Entering source directory /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u
10:27:54 T:2955980800 DEBUG: Instantiating addon using automatically obtained id of "script.itunestom3u" dependent on version 1.0 of the xbmc.python api
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:36: SyntaxWarning: import * only allowed at module level
def __init__(self):
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:20: DeprecationWarning: os.getcwd() currently lies to you so please use addon.getAddonInfo('path') to find the script's root directory and DO NOT make relative path accesses based on the results of 'os.getcwd.'
PLUGIN_PATH = xbmc.translatePath(os.getcwd())
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:30: DeprecationWarning: os.getcwd() currently lies to you so please use addon.getAddonInfo('path') to find the script's root directory and DO NOT make relative path accesses based on the results of 'os.getcwd.'
addon = xbmcaddon.Addon(id=os.path.basename(os.getcwd()))
10:27:55 T:2894398144 DEBUG: ------ Window Init (DialogBusy.xml) ------
10:27:55 T:2894398144 DEBUG: Alloc resources: 0.01ms (0.00 ms skin load)
10:27:56 T:2958184448 INFO: Loading skin file: DialogProgress.xml
10:27:56 T:2958184448 DEBUG: Load DialogProgress.xml: 4.86ms
10:27:56 T:2958184448 DEBUG: DialogProgress::StartModal called
10:27:56 T:2958184448 DEBUG: ------ Window Init (DialogProgress.xml) ------
10:27:56 T:2958184448 DEBUG: Alloc resources: 0.29ms (0.00 ms skin load)
10:27:59 T:2894398144 DEBUG: ------ Window Deinit (Pointer.xml) ------
10:28:14 T:2955980800 INFO: -->Python script returned the following error<--
10:28:14 T:2955980800 ERROR: Error Type: <type 'exceptions.KeyError'>
10:28:14 T:2955980800 ERROR: Error Contents: ('Location',)
10:28:14 T:2955980800 ERROR: Traceback (most recent call last):
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py", line 81, in <module>
run_program = Main()
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py", line 70, in __init__
number_playlist= itunesconvert(libraryfile,oldmusicpath,musicpath,m3u_path)
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/resources/lib/xmltom3u.py", line 37, in itunesconvert
fileloc_quote = playlist['Tracks'][str(track_id)]['Location']
KeyError: ('Location',)
10:28:14 T:2955980800 INFO: -->End of Python script error report<--
10:28:14 T:2894398144 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
find quote
steveaggie Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Thumbs Up    Post: #15
Hey just wanted to say this script works pretty well and is very useful. It works fine in Eden Beta 3 on Windows 7 the first time you run it. It does exactly what it says it will do. What I've found though is that you can't run it twice or it gets a script error. You have to restart XBMC to rerun it. I'm assuming the scheduled update won't work either due to this.

Not a big deal, but this looks like an old thread and wanted to see if you were still doing development on this. I love it and would love it even more if it would regularly pull down playlists. Thanks!
find quote
xSoul Offline
Junior Member
Posts: 2
Joined: Jul 2012
Reputation: 0
Post: #16
(2011-08-26 10:47)reddwarf355 Wrote:  Getting the following errors:


10:27:54 T:2958184448 DEBUG: WaitOnScriptResult - waiting on the iTunes Playlist Importer plugin...
10:27:54 T:2955980800 NOTICE: -->Python Interpreter Initialized<--
10:27:54 T:2955980800 DEBUG: Process - The source file to load is /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py
10:27:54 T:2955980800 DEBUG: Process - Setting the Python path to /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u:/Users/maurice/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/maurice/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pysqlite/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages:
10:27:54 T:2955980800 DEBUG: Process - Entering source directory /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u
10:27:54 T:2955980800 DEBUG: Instantiating addon using automatically obtained id of "script.itunestom3u" dependent on version 1.0 of the xbmc.python api
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:36: SyntaxWarning: import * only allowed at module level
def __init__(self):
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:20: DeprecationWarning: os.getcwd() currently lies to you so please use addon.getAddonInfo('path') to find the script's root directory and DO NOT make relative path accesses based on the results of 'os.getcwd.'
PLUGIN_PATH = xbmc.translatePath(os.getcwd())
10:27:54 T:2955980800 ERROR: /Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py:30: DeprecationWarning: os.getcwd() currently lies to you so please use addon.getAddonInfo('path') to find the script's root directory and DO NOT make relative path accesses based on the results of 'os.getcwd.'
addon = xbmcaddon.Addon(id=os.path.basename(os.getcwd()))
10:27:55 T:2894398144 DEBUG: ------ Window Init (DialogBusy.xml) ------
10:27:55 T:2894398144 DEBUG: Alloc resources: 0.01ms (0.00 ms skin load)
10:27:56 T:2958184448 INFO: Loading skin file: DialogProgress.xml
10:27:56 T:2958184448 DEBUG: Load DialogProgress.xml: 4.86ms
10:27:56 T:2958184448 DEBUG: DialogProgress::StartModal called
10:27:56 T:2958184448 DEBUG: ------ Window Init (DialogProgress.xml) ------
10:27:56 T:2958184448 DEBUG: Alloc resources: 0.29ms (0.00 ms skin load)
10:27:59 T:2894398144 DEBUG: ------ Window Deinit (Pointer.xml) ------
10:28:14 T:2955980800 INFO: -->Python script returned the following error<--
10:28:14 T:2955980800 ERROR: Error Type: <type 'exceptions.KeyError'>
10:28:14 T:2955980800 ERROR: Error Contents: ('Location',)
10:28:14 T:2955980800 ERROR: Traceback (most recent call last):
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py", line 81, in <module>
run_program = Main()
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/addon.py", line 70, in __init__
number_playlist= itunesconvert(libraryfile,oldmusicpath,musicpath,m3u_path)
File "/Users/maurice/Library/Application Support/XBMC/addons/script.itunestom3u/resources/lib/xmltom3u.py", line 37, in itunesconvert
fileloc_quote = playlist['Tracks'][str(track_id)]['Location']
KeyError: ('Location',)
10:28:14 T:2955980800 INFO: -->End of Python script error report<--
10:28:14 T:2894398144 DEBUG: ------ Window Init (DialogKaiToast.xml) ------

I get the same error... Sad
(This post was last modified: 2012-08-01 02:29 by xSoul.)
find quote
samuwilliam Offline
Junior Member
Posts: 3
Joined: Oct 2012
Reputation: 0
Post: #17
Similar error here running Frodo with iTunes 11. Anyone having any better luck?

Code:
21:03:06 T:4536  NOTICE: -->Python Interpreter Initialized<--
21:03:06 T:4536   DEBUG: XBPyThread::Process - The source file to load is C:\Users\samuel\AppData\Roaming\XBMC\addons\script.itunestom3u\addon.py
21:03:06 T:4536   DEBUG: XBPyThread::Process - Setting the Python path to C:\Users\samuel\AppData\Roaming\XBMC\addons\script.itunestom3u;C:\Users\samuel\A​ppData\Roaming\XBMC\addons\script.module.myconnpy\lib;C:\Users\samuel\AppData\Ro​aming\XBMC\addons\script.module.beautifulsoup\lib;C:\Users\samuel\AppData\Roamin​g\XBMC\addons\script.common.plugin.cache\lib;C:\Users\samuel\AppData\Roaming\XBM​C\addons\script.module.buggalo\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\s​cript.module.xbmcswift2\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\script.m​odule.xbmcswift\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\script.module.t0​mm0.common\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\script.module.chardet​\lib;C:\Program Files\XBMC\addons\script.module.simplejson\lib;C:\Program Files\XBMC\addons\script.module.pil\lib;C:\Users\samuel\AppData\Roaming\XBMC\add​ons\script.module.simple.downloader\lib;C:\Users\samuel\AppData\Roaming\XBMC\add​ons\script.module.urlresolver\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\sc​ript.module.rssengine\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\script.mod​ule.parsedom\lib;C:\Users\samuel\AppData\Roaming\XBMC\addons\script.module.eleme​nttree\lib;C:\Program Files\XBMC\addons\script.module.pysqlite\lib;C:\Users\samuel\AppData\Roaming\XBM​C\addons\script.module.metahandler\lib;C:\Program Files\XBMC\system\python\DLLs;C:\Program Files\XBMC\system\python\Lib;C:\Program Files\XBMC\python26.zip;C:\Program Files\XBMC\system\python\lib\plat-win;C:\Program Files\XBMC\system\python\lib\lib-tk;C:\Program Files\XBMC;C:\Program Files\XBMC\system\python;C:\Program Files\XBMC\system\python\lib\site-packages;
21:03:06 T:4536   DEBUG: XBPyThread::Process - Entering source directory C:\Users\samuel\AppData\Roaming\XBMC\addons\script.itunestom3u
21:03:06 T:4536   DEBUG: Instantiating addon using automatically obtained id of "script.itunestom3u" dependent on version 1.3 of the xbmc.python api
21:03:06 T:4536   ERROR: C:\Users\samuel\AppData\Roaming\XBMC\addons\script.itunestom3u\addon.py:37: SyntaxWarning: import * only allowed at module level
                                              def __init__(self):
21:03:06 T:4536   ERROR: EXCEPTION: Could not get AddonPtr given a script id of XBMC.If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 1.3 plugin.
21:03:06 T:4536   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: Could not get AddonPtr given a script id of XBMC.If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 1.3 plugin.
                                            Traceback (most recent call last):
                                              File "C:\Users\samuel\AppData\Roaming\XBMC\addons\script.itunestom3u\addon.py", line 30, in <module>
                                                addon = xbmcaddon.Addon(id=os.path.basename(os.getcwd()))
                                            RuntimeError: Could not get AddonPtr given a script id of XBMC.If you are trying to use 'os.getcwd' to set the path, you cannot do that in a Version: 1.3 plugin.
                                            -->End of Python script error report<--
(This post was last modified: 2013-01-07 03:10 by samuwilliam.)
find quote
samuwilliam Offline
Junior Member
Posts: 3
Joined: Oct 2012
Reputation: 0
Post: #18
In case someone is interested in a temporary fix I ended up replacing all instances of os.getcwd() in addons.py with the actual working directory for the plugin.

Maybe someone could suggest an alternate function to os.getcwd() to return the current working directory rather than hardwiring the path in as I have done.

EDIT
The above method only works on OSX. Trying in Windows results in XBMC crashing.
(This post was last modified: 2013-01-07 06:19 by samuwilliam.)
find quote
aussiewilliams Offline
Junior Member
Posts: 8
Joined: Feb 2012
Reputation: 0
Post: #19
Hi Dave,

whenever I launch the addon I get ERROR script failed addon.py - I am running xbmc 12.2 on mac osx 10.8.

would be nice to have this working.

cheers
aussie
find quote
Post Reply