INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Mac => Topic started by: AugieJoe on February 01, 2014, 01:21:29 pm

Title: Transfer playlists from iTunes to MC: What is now the best method?
Post by: AugieJoe on February 01, 2014, 01:21:29 pm
[Edit by JimH: Please see this post:
https://yabb.jriver.com/interact/index.php/topic,87171.msg836569.html#msg836569 ]

After last upgrade, To transfer playlists from iTunes to MC: What is now the best method on the Mac?
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 03, 2014, 01:20:08 pm
Playlists in iTunes are stored in XML in the file:

    iTunes Music Library.xml

so you have to Export your playlists.  iTunes provides only a way to export a single playlist at a time, but there are probably scripts you can use to export all playlists.

Once you have those playlists exported, MC should be able to read them.  I haven't tested all the export formats, so maybe try m3u first.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 03, 2014, 07:50:41 pm
Are files separately coded as XML or is it the playlist itself? By export, you would place them as folders that MC can address ??
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 03, 2014, 07:58:06 pm
The playlist contents for iTunes playlists are stored within the iTunes library file iTunes Music Library.xml.  There are entries inside that file for each iTunes playlist.

By export, I meant, that within iTunes, you can do a File > Library > Export Playlist command, and save the file in one of several formats.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 03, 2014, 10:35:01 pm
Ok, so this created XML (playlist) is recognized by MC, and imports like any other audio file ?
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 03, 2014, 11:06:31 pm
I haven't tested all the formats of iTunes playlist exports.  Give them each a try and let us know how it works out.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 04, 2014, 02:27:44 pm
Ok, exported one of my Tunes(Osx10.6.8) playlists in all formats. Checked to see if they all would reload the playlist in Tunes and they did. Though they all instantly load in MC they did so as blank pages. MC recognized them as "albums".... Not sure what all this means but playlists did not travel with the file from the music folder.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 04, 2014, 04:04:17 pm
I'm having a hard time understanding some of what you've written.  Nonetheless, here are my findings:

iTunes will export playlists in 5 formats:

   Text File (.txt)
   Unicode Text File (.txt)
   XML (.xml)
   M3U (.m3u)
   M3U8 (.m3u8)

MC 19.0.103 does not deal with any of the correctly, for various reasons.

To get an iTunes m3u playlist imported, you need convert the line endings to proper form.  Use this utility to do so:

   http://yabb.jriver.com/interact/index.php?topic=83767.msg572203#msg572203

Once converted, you can File > Import Playlist withing MC to import the referenced files.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 05, 2014, 09:30:02 am
Downloaded the zip file to desktop, and assume that double clicking it is the unzip procedure ?
Anyway when I drag a playlist over the top it sits there as an ITunes file to be played, and though MC opens these from desktop, there are no files. Missing something MrC, thanks for all he help to date.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 05, 2014, 10:45:18 am
Yes, you double click the zip file to extract it.  It will create a scriptlet, which you drag your iTunes m3u playlists onto.  It will modify the files in place.  When the modifications are done (very fast), you can use MC's File > Import Playlist to import the converted m3u playlist files.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 05, 2014, 04:39:45 pm
Sorry to report that when I drag my m3u playlist file from Finder, over onto the unzipped icon, nothing happens. No new file appears in finder that MC can be directed to. When I go to MC import playlist, the m3u files show under my music folder but when opened they do not load up in the MC player under the action pane. I must be missing something. It would seem that dragging the m3u file over the MC scripter that something ( a new folder or file) would appear. All I see in Finder is the same m3u playlist which when opened plays the ITunes files within.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 05, 2014, 06:08:16 pm
No, I mentioned above the automator script works in place - no new files are created.

Open an M3U file in an editor on the Mac.  Look at the paths of the files.  Do those paths and files exist?

These are from an older iTunes - can you zip an original (not converted) m3u playlist, and attach it to a reply here?
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 05, 2014, 07:44:33 pm
When you mention import playlist from MC file above, where are you pulling the "in place" files from ? For me that appears as the playlist's 3mu file, as constructed in the beginning as an export of ITunes under Desktop in Finder. There is no MC scripted file or folder which concurs with your statement. How does MC import unless it finds the script automatically off the desktop ? I'll see about sending the 3mu files as created from ITunes export, if that is what you are referring to ?
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 05, 2014, 09:36:22 pm
The process is quite simple:

1. Drag your iTunes M3U playlist file onto the itunesm3u_2_MC Automator script you downloaded.
2. Use MC on the same system where you generated the iTunes M3U playlist file and select the menu File > Import Playlist and select that M3U playlist file.

The import will cause two things to happen: 1) the playlist file itself will get imported into MC, and 2) all files referenced inside that playlist file will be imported into MC provided those paths are valid on the MC system and MC can access the files.

The paths in the playlist must be usable by MC, so if you transferred these playlists files from another system, that won't work.  You'd have to correct the filepaths inside.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 05, 2014, 10:14:07 pm
Followed verbatim  as you describe with no success. All files,created,on same Mac computer and drive. I see MC attempt to load in the action pane, but reports "0" files imported. I will try to reload the Automator.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 05, 2014, 10:42:43 pm
This is what it should look like:

   https://dl.dropboxusercontent.com/u/87189402/iTunes_M3U_to_MC.mp4 (https://dl.dropboxusercontent.com/u/87189402/iTunes_M3U_to_MC.mp4)

Maybe this is a problem with your version of Mac OS X, or iTunes?

I need to see one of your raw M3U files right after you export it from iTunes.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 07, 2014, 02:03:46 pm
Ok, so I was highlighting the files within the playlist, selecting all, and then dragging them in whole over to the script. WRONG. Now I have selected the playlist namesake and dragged to the Automator script. Worked well and when I imported to MC now the files load. However, the files are nonsense, not audio. Besides the fact various foreign language files appear, we basically have one of the following file paths in MC;

 ApplicationStub   nib    /users/MacMini/desktop/ITunesm3u_2_MC.app/contents/resources/ar.lproj/ApplicationStub.nib

* other files in the list replace the "ar" with ca, cs, da, el ......etc etc

Running OSX 10.6.8     ITunes 10.6.1 (7)
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 07, 2014, 02:30:31 pm
Probably there are differences in the Automator versions between our systems.  Yours is pretty ancient.  Are you familiar with the command line or Terminal?  I can give you a command to run that will fix the files directly.  I supplied the Automater to make it easier for folks, but clearly it doesn't work between our Mac OS X versions.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tasar on February 07, 2014, 07:05:34 pm
Anything to bring the files to. Playable/identifiable form would be most appreciated. Is this yet another reason to update to 10.9 other than integer ? Really don't want to go down to paths with playlists if the OS is culprit.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 07, 2014, 07:16:53 pm
Ok, here you go...

1. Place your m3u files in a folder on your Desktop, let's call it Playlists
2. Launch Terminal
3. In Terminal, type:

     cd Desktop/Playlists

and hit Enter.
4. To convert all your m3u files in that folder, copy and paste the following into Terminal:

   perl -i -pe  's/\R/\n/g'  *

and hit Enter.

5. Your playlists are now converted, and MC should be able to import them.  Use MC's File > Import Playlist.

I think the issue we were having with conversion using Automator is that my Automator script you downloaded was created in my version of Mac OS, and it probably is not backwards compatible with yours.  As far as should you convert, that's entirely up to your and your needs.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: Fred1 on February 07, 2014, 10:57:04 pm
Is it only a line endings affair?
Can't do MC that itself - shouldn't be too complicated?

By the way: What's the matter with the contrary way?
How to convert MC's playlists to iTunes' playlists to sync iDevices via iTunes?
That seems most important to me.

Thanks MrC for your permanent efforts to help us!
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 08, 2014, 04:00:13 am
You've got it Fred1.  It is just the line endings differences.  I suppose its just one of many items on the large To Do list for the Mac.

MC can export M3u and M3U8 playlist files which iTunes can import.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on February 10, 2014, 01:46:52 pm
Here's a utility to convert line endings that folks may find more friendly:

   http://code.google.com/p/linebreak/
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: Maeghaus on April 29, 2014, 06:49:28 am
Importing and Converting iTunes XML Files To Media Center 19 Mac
A Tutorial by Maeghaus

If you're attempting to import playlists from iTunes to MC 19 Mac, you can use the M3U converter offered by JRiver (see above). The converter is very handy, and will save you a lot of messing about with text editing.

However, at least as far as my experience goes, the converter does not import items such as play count ("Plays" in iTunes, "Number Plays" in MC) and other similar info. These items are stored in the iTunes XML file. To import iTunes playlists with this additional info, you need to export each playlist as an XML file, modify the file paths, and then import each playlist into MC.

Editing XML files is not as complicated as it seems. What you need to edit them is an XML file editor. Dashcode (an Apple Developer program) used to be the editor of choice, but Apple no longer supports this program, and it will not run on Mavericks (10.9). I have found that Bare Bones Software's free editor TextWrangler to be an admirable replacement program. I do not recommend Apple's Text program. It will open the file but may not correctly save the XML structure.

This procedure works under iTunes 10.7 and 11.x and was originally used in MC 18. The procedure is adapted for MC 19 for music files (MC Mac as of this post does not support other media formats yet. Importing Video may end up being similar or a different procedure entirely).

This procedure takes place entirely on the Mac side. I need to test a PC>Mac conversion to explain any differences that may arise with that process.

1. You can export an iTunes playlist to XML format by highlighting and then right-clicking on the playlist in iTunes. Choose Export. A file save dialog box will appear with some format options. Be sure that "XML" is selected. Save the file to a location (such as making a folder called "XML" and saving the playlist there). If you have multiple playlists to export, a file folder will help you to organize them into one location. I suggest saving a copy of the unedited XML playlist in case you need to edit again or the process doesn't work initially. You can always export the playlist again in iTunes and start fresh that way.

[Edit by JimH -- Steps 2 to 5 can be replaced by using MrC's method below (http://yabb.jriver.com/interact/index.php?topic=87171.msg610620#msg610620).]

2. This part of the process is dependent on your music's file folder location(s). Note the path -- write it down or copy to clipboard, some way to reference the path.
-- For Example: If you use the default Apple iTunes music folder location, under Get Info, the file folder would be /Users/<username>/Music/iTunes.
-- Another Example: On a different/external drive, the file path adds the location "/Volumes/<drive name>" plus any subfolders (say, "Volumes/<drive name>/<subfolder>".
-- For additional/different file location, use Get Info to see the file path. The Get Info function will reveal your complete file location path.

2. Next you need to open the XML file in your editor. Open the XML editor and select the playlist file. (File>Open in TextWrangler). The program should open up a structured code file. Ignore the wall of text and focus on the area where you will do the actual editing, the file locations.

3. Now you can begin editing the file locations so that MC will be able to see where the files are located. The first area to look in is:

<key>Music Folder</key><string>file://localhost/[drive volume]/<string>
Example 1: <key>Music Folder</key><string>file://localhost/Volumes/Tom's%20Media%20Library/</string>
Example 2: <key>Music Folder</key><string>file://localhost/Users/tomp/Music/

-- Delete the following text file://localhost, leaving the directory [drive volume] intact.

4. Next, look for the first music file entry further down the list. This entry will look similar to:

<key>Location</key><string>file://localhost/<file folder>/[Artist]/[music file]</string>
Example: <key>Location</key><string>file://localhost/Users/tomp/Music/ABBA/01%20Mamma%20Mia.mp3</string>

With multiple entries in a typical XML playlist, manually editing each track is time-consuming to say the least. You can shortcut by using the Find/Replace function in your editor. In the case of TextWrangler, it's under Search>Find. You should see the Find and Replace options. Type or Paste in Find this text:

file://localhost (no slash at the end)

For the Replace option, leave that blank. Select the command Replace All. Even if you have a large playlist of hundreds of songs, the conversion of the Replace All process takes only seconds.

5. Save the XML file.

Repeat the process for each iTunes playlist you need to export and edit. TextWrangler has a Multiple Files search-and-replace function that can batch edit several XML files at once. All you need to do is edit each file as stated, and then select Multiple Files to select the XML files you want to convert. Remember to Save each file after completing.

6. Import an XML file into MC: In Media Center 19, select File>Import Playlist, choose a file, and click Open. The importing process may take a few minutes if you have a large file; just be patient. MC will show that it is processing in the Action window. Also, not only will you have an imported playlist from iTunes, but any music files that were not previously in MC will be imported as well. Don't worry about duplicate files; MC won't import a music file again if the file path already exists in the program.

Process compiled as of April 29, 2014. Please ask questions if you need, or if you discover errors in the process as stated above.

I would be pleased if JRiver would make this a sticky, or at least a Wiki reference. But that's up to you guys. ;D

-- Tom
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on April 29, 2014, 01:40:30 pm
Maeghaus,

See:

   http://yabb.jriver.com/interact/index.php?topic=88329.msg605680#msg605680
   http://yabb.jriver.com/interact/index.php?topic=88818.msg610619#msg610619
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: Maeghaus on April 29, 2014, 03:06:55 pm
Thomas Huxley once said something about that there were no more original ideas. I suppose I should have known the discussion in the Windows forum since I posted there a long time ago but I guess I was attempting to show the Mac version of those links. That's why I don't post often: most of what I want to say is already on the forums in some fashion or other. But please accept my posting as an effort to help users with MC. Thanks for posting the links. That will help tie in with the Windows topics.

I really enjoy Media Center and JRiver's great community. I don't think I would have figured out the XML process in the first place if it wasn't for you guys.

-- Tom
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on April 29, 2014, 03:33:23 pm
Your posting was great, and it gave me the knowledge / info I needed to update the script to work with iTunes' XML, so a very big thanks!
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: MrC on April 30, 2014, 05:24:56 pm
Prompted by Maeghaus' fine post above, I did some exploratory work to see why iTunes' XML playlists were not being imported.  I discovered the cause, and reported it as a bug.  JohnT promptly addressed this, so now you should be able to import iTunes' XML playlists directly starting with the 19.0.131 release:

   http://yabb.jriver.com/interact/index.php?topic=89012.0


19.0.131 (4/30/2014)

3. Fixed: XML playlist exports from iTunes were not importing because of 'file://localhost/' embedded in filenames.
4. Fixed: File rename & copy was producing duplicate library entries when processing filenames containing international characters.
5. Fixed: M3U playlist exports from iTunes were not importing because of line ending issues.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: Frosch on December 16, 2014, 03:42:01 pm
Importing and Converting iTunes XML Files To Media Center 19 Mac
A Tutorial by Maeghaus
.....

Tom/Maeghaus,

does this method still work with MC 20 for Mac and latest OS X (Yosemite) ?

Jens

Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: tlang on February 19, 2015, 04:10:44 pm
I just used notepad to change the filepaths (find / replace ) and it worked fine with jriver 20.  Very easy.  Of course, you can also just make new playlists, as it is fun to do.
Title: Re: Transfer playlists from iTunes to MC: What is now the best method?
Post by: JimH on June 11, 2019, 10:51:47 am
JRiver Media Center 25 added iTunes Playlist Import (https://yabb.jriver.com/interact/index.php/topic,120942.0.html).  It imports native iTunes playlists and all media from iTunes.  It doesn't move or change the files.