caseychu / spotify-backup

A Python script that exports all of your Spotify playlists.
MIT License
847 stars 123 forks source link

Add plain-txt output format and change newline character #45

Open bfrolikov opened 2 years ago

bfrolikov commented 2 years ago

For ease of import into other streaming services, added a new output format called plain-txt that only outputs song titles and artist names, like this: <title> - <artist name>.

Also, here's an excerpt from the Python documentation on the open method:

When writing output to the stream, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '' or '\n', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string.

So, when writing to the file, \n should probably be used instead of \r\n for cross-platform support.