GNOME Bugzilla – Bug 584899
[Formatter] Fix .pls/.m3u Formatters
Last modified: 2009-06-29 15:07:38 UTC
right now pitivi only reads pls files, which one has to guess or read in the code. another common extension for simple playlists is m3u
Created attachment 136004 [details] [review] add m3u to list of playlist extensions
so... pls and m3u files are all the same ? Just a list of uri (one per line) ?
yes basically one uri per line after removing those starting with # from http://en.wikipedia.org/wiki/M3U An M3U file is a plain text file that contains the locations of one or more media files that the mediaplayer should play. Each location is placed on a new line. The locations can be either absolute or relative local pathnames (e.g., "C:\My Music\Heavysets.mp3" or "Heavysets.mp3") or they can be URLs. The file can also include comments, prefaced by the "#" character. In extended M3U, "#" also introduces extended M3U directives. pls on the other hand is not, example from http://en.wikipedia.org/wiki/PLS_%28file_format%29 <pre> [playlist] NumberOfEntries=3 File1=http://streamexample.com:80 Title1=My Favorite Online Radio Length1=-1 File2=http://example.com/song.mp3 Title2=Remote MP3 Length2=286 File3=/home/myaccount/album.flac Title3=Local album Length3=3487 Version=2 </pre>
Ok, then changing the bug title accordingly :)
so pls is ini config format, here a minimal parser to get the list of files: def filesFromPls(filename): import ConfigParser config = ConfigParser.ConfigParser() config.read(filename) files = [] for i in range(config.getint('playlist', 'NumberOfEntries')): files.append(config.get('playlist', 'File%d' % (i+1))) return files
Created attachment 136011 [details] [review] parse pls format and add m3u to list of playlist extensions