Click to See Complete Forum and Search --> : I doubt it, but: Playlists
KyPeN
03-06-2004, 01:27 PM
Ok, Here is the dillio:
I have 5700+ songs on my HDD. I went through all of them, and picked out my favorites and put them on a playlist (in Windows XP). Is there any software in Linux that can import and read it? I know that many still use the .m3u playlist format, but I have yet to find one that can actually read F:\My Documents...etc. instead of /mnt/F/My....etc
Any advice? I don't plan on taking all that time again.
EnigmaOne
03-06-2004, 01:45 PM
XMMX has drag-n-drop playlist creation.
I've never depended on windoze for anything, so I can't answer the import question directly. I'm sure that, if you search around a bit, you will fins some utilities that will save you from creating a playlist in Linux.
As to the /mnt/x/y/z/ access to your windoze partition...uh...that's the way it works, and there are good reasons for this.
Don't expect Linux to use back-slashes, colons, and DOS drive lettering for partition access.
If your playlist is in ASCII format, it's a trivial matter to replace the file path specs with the correct path format. (Something on the order of a half-second of F&R time in a GUI, and nearly instantaneous at the console.)
happybunny
03-06-2004, 01:45 PM
sure....but it will take some scripting or editing...
the m3u file is simply a text document with a location to a song.
right now it says something like c:\mp3s\songtitle
edit that to say /mnt/mp3/songtitle by doing a find a replace on that file.
should work.
5700+ huh? Not a bad start anyway!!
pickarooney
03-06-2004, 02:24 PM
If the playlists are all in the same directory you could use something like:
for plist in *.m3u
do
cat $plist|while read song
do
base=`basename $song`
locate $base >>$plist_new.m3u
done
done
You may need to use some " " around various variables.
Actually, I don't know what WMP playlists look like, if they're not just a straight list of files you'll have to filter out the extra info. If you post a sample one, I can see.
KyPeN
03-06-2004, 07:59 PM
The aren't WMP playlists, they are m3u
Please forgive me, but I'm still quite a newb as far as scripting goes. In fract, I have written a total of one script, and that just opens 5 programs at one time. Sad, I know. Another problem is that the paths to the songs as well as the songs themselves have spaces in them. What would those be replaced with?
pickarooney
03-06-2004, 08:44 PM
Can you post a sample .m3u? I'm just thinking, that basename thing won't work as the slashes are the other way around in Windows...
Spaces aren't too hard to deal with, they may need to be escaped with the \ character or surrounded by "", depending on.
cybertron
03-06-2004, 08:59 PM
I know this might sound heretical to you command line buffs, but wouldn't it be almost trivial to open the m3u in a text editor (kwrite for example) and do a find and replace on every instance of F:\ with /mnt/f/ or whatever? Same with the slashes, just swap one for the other. Maybe this wouldn't work the way I think it would, but to my newbie self it makes sense.
Edit: Looks like I'm just repeating what a couple of other people have already said. It's still good advice.
pickarooney
03-06-2004, 09:00 PM
Sure it would, if you didn't have 1000s of playlists to edit :)
cybertron
03-06-2004, 09:02 PM
I went through all of them, and picked out my favorites and put them on a playlist (in Windows XP).
Hmm. The words "a playlist" suggested to me that there was only one.
pickarooney
03-06-2004, 09:17 PM
Oh yeah, so there is... don't see what the problem is then. Still, might be nice to be able to do it for a lot of playlists at once.
cybertron
03-06-2004, 09:23 PM
True. I'm sure one of the grep/sed experts around here could easily write a script to do it, but I'm definitely not among their number :)
It could be that it was just a typo too, I've gotten the impression from subsequent posts that maybe there is more than one file.
Whatever:D
KyPeN
03-07-2004, 01:03 AM
One file/playlist
Here is a sample as requested, and no need to commend on the music:
F:\My Documents\My Music\Notorious B.I.G_\Rap Tracks #7\18 Hypnotise.mp3
F:\My Documents\My Music\Obie Trice\Cheers\04 Lady [f Eminem] 1.mp3
F:\My Documents\My Music\Obie Trice\Cheers\08 **** Hits The Fan [f Dr. Dre] 1.mp3
F:\My Documents\My Music\Obie Trice\Cheers\10 We All Die One Day [f 50 Cent, Ll.mp3
F:\My Documents\My Music\Obie Trice\Cheers\13 Hands On You [f Eminem].mp3
F:\My Documents\My Music\Obie Trice\Cheers\15 Oh! [f Busta Rhymes] 1.mp3
F:\My Documents\My Music\Office Space Soundtrack\Office Space Soundtrack\Damn It Feels Good To Be A Gan.mp3
F:\My Documents\My Music\Office Space Soundtrack\Office Space Soundtrack\I Got This Killer Inside of Me.mp3
F:\My Documents\My Music\Ozzy Osbourne\Down To Earth\03 Dreamer 1.mp3
F:\My Documents\My Music\Ozzy Osbourne\The Ozzman Cometh\Crazy Train.mp3
F:\My Documents\My Music\Ozzy Osbourne\The Ozzman Cometh\No More Tears.mp3
F:\My Documents\My Music\P. Diddy\Unknown Album\Mo Money, Mo Problems.MP3
F:\My Documents\My Music\P. Diddy\Soundrack\Come with Me ft. Jimmy Page.mp3
F:\My Documents\My Music\P. Diddy\Tribute to the Notorious B.I.G\01 I'll Be Missing You.mp3
F:\My Documents\My Music\Pearl Jam\Ten\Jeremy.mp3
F:\My Documents\My Music\Phish\Farmhouse\01 Farmhouse 1.mp3
They are far more simple than I assumed. So replace all F:\ with /mnt/F and put them all in quotes?
cybertron
03-07-2004, 02:02 AM
So replace all F:\ with /mnt/F and put them all in quotes?
Close. You'll also need to replace all of the \ characters with a / character because Linux will interpret the \ as an escape sequence (correct term?). I'm also not positive you'll need any quotes. It'll depend on how your program loads the file. For instance, I wrote my own GUI for MPlayer with its own playlist format, and I don't need quotes around the filenames even if they have spaces. Since the file doesn't start out with quotes, I would guess it doesn't need them (Windows has the same problems reading spaces as Linux). Also, I'm not sure it would be quite as easy to add quotes. I suppose you might be able to do a find/replace on *\n with "*\n" but I'm not at all sure that would work.
At any rate, make a backup copy of the file and then play around with it a little and see what works. That's frequently my solution to problems I have in Linux.