Skip to content

Finds all Spotify tracks in a given text and adds them to a Spotify Playlist

License

Notifications You must be signed in to change notification settings

dirkluijk/text-to-playlist

Repository files navigation

Text to playlist 🎸

JSR version Build status

Simple CLI script written in Deno to sync Spotify tracks from a raw text to a Spotify playlist.

Usage

Install the script with Deno:

deno install jsr:@dirkluijk/text-to-playlist --global --allow-net --allow-run 

Now just run it:

text-to-playlist <inputFileOrText> --playlist <playlistUrl>

To run the script without installing, run:

deno run jsr:@dirkluijk/text-to-playlist <inputFileOrText> --playlist <playlistUrl>

Required permissions

  • allow-net: to make network requests to the Spotify Web API
  • allow-run: to open the browser for authorization
  • allow-read: to read the input file (optional)

Options

-h, --help                            - Show this help.                                                                  
-V, --version                         - Show the version number for this program.                                        
-P, --playlist         <playlistUrl>  - The Spotify Playlist URL to add to tracks to                      (required)     
-D, --debug                           - Outputs debugging logs                                                           
--remove-duplicates    [flag]         - Whether to filter out duplicates from input                       (Default: true)
--remove-other-tracks  [flag]         - Whether to remove tracks from playlist that do not exit in input  (Default: false)

Programmatic usage

To use this library in Deno, install it from JSR:

deno add jsr:@dirkluijk/text-to-playlist
import { textToPlaylist } from "@dirkluijk/text-to-playlist";

await textToPlaylist("some text or file", "link to playlist");

Check out the API docs here.

Contributors

About

Finds all Spotify tracks in a given text and adds them to a Spotify Playlist

Resources

License

Stars

Watchers

Forks

Packages

No packages published