# spot2txt A small tool to export Spotify Playlist track listings (with some minimal metadata) as plaintext for archival purposes. ## Dependencies Outside standard Perl 5 core modules, the libwww and Mojolicious modules are required. On OpenBSD 7.6 the following packages are sufficient: - p5-libwww - p5-LWP-Protocol-https - p5-Mojolicious ## Running Spotify uses Oauth2.0 to get authentication tokens scoped to a specific set of permissions and user session (by having the user log in and accept said permissions). This login process requires a browser. As such, the program is split into two parts: the authorization flow, and the CLI itself. ### Authorization Create a Spotify Developer account and an Application. Put the Client ID and Secret in the SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET environment variables. Make sure http://localhost:3000/auth is the redirect URL. Next, run `get-token.pl` as a Mojolicious server: $ morbo get-token.pl And visit localhost:3000 in the browser. Click the link and it should log in, redirect back, and dump the token into the web page. ### Playlist Exporter (CLI) Put the token from the browser in the environment as SPOTIFY_TOKEN and run the script cli.pl: $ ./cli.pl your-spotify-username The listings will be written to the a new "out" directory.