#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Text file to .pls problem in python3 program


    I'm using python 3 to develop a program that reads an itunes playlist (.txt) and turns it into a playlist to be used by rythombox in ubuntu (.pls). I had to resave the original .txt as a .txt in unicode first and now i have my generated playlist which when i open in gedit looks identical to a playlist that I made in rythmbox on ubuntu. The files are all from the same directory, same number of files, both .pls but when i load the generated playlist in rythmbox it only adds a select few of the songs which are all from the same album. The other songs from other albums are not being added and I don't know why. When both files are opened in gedit they are identical except for the order of the songs in the playlist.

    If you find this same question on yahoo answers it's because I originally posted it there but decided it would be a better idea to post it here instead.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480

    The .pls file is in the form of an ini file


    http://en.wikipedia.org/wiki/PLS_(file_format)

    The .pls file is in the form of an ini file.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Pls file


    My program is generating the new file and saving it an when I open the new file in a text editor and look at it and open a pls made in rhythm box they are both in the same exact format, both in utf 8 encoding with Linux line endings and both .pls. From what I can tell they are the same, even pulling the songs from the same directory, so I don't think it's formatting unless there is some line that gedit is not showing that needs to be changed
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    You can use
    $ diff RB.pls MY.pls
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by b49P23TIvg
    You can use
    $ diff RB.pls MY.pls
    I'm sorry I'm not fimiliar with that? can you elaborate, what is "$ diff RB.pls MY.pls
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    The rhythmbox playlist file ( RB.pls ) and your playlist file ( MY.pls ) differ.

    To find out how they differ use the diff command.


    Start a terminal window.
    Change directory to the directory holding the two files.
    Use the command

    linux_shell_prompt$ diff --side-by-side RB.pls MY.pls


    You type this part:
    diff --side-by-side RB.pls MY.pls

    If the files are in different directories the command would be

    diff --side-by-side path/RB.pls another_path/MY.pls

    Where for path and another_path substitute the actual directory in which these files reside.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo