Giter Site home page Giter Site logo

alhuelamo / spotify-next Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubukoz/spotify-next

0.0 0.0 0.0 854 KB

Small CLI app for filtering out music on Spotify.

License: Other

Scala 89.55% HTML 2.18% Nix 0.68% CSS 0.22% JavaScript 5.46% Shell 1.92%

spotify-next's Introduction

spotify-next

License

A small program making it easier to filter out music on Spotify.

asciicast

Installation

  1. Create an application in the Spotify API dashboard. Add a redirect URI pointing to http://localhost:4321/login. The port 4321 is configured in the .spotify-next.json config file (see usage).

  2. If you have coursier, this will install the app in your current working directory:

coursier bootstrap com.kubukoz:spotify-next_3:1.4.0 -o spotify-next

# now you can run the app like this:
./spotify-next --help

Build from source

Alternatively, if you want a fresh-out-of-the-oven version, you can build it from source:

  1. sbt stage

This will create a launcher at ./target/universal/stage/bin/spotify-next.

Usage

The application requires some configuration (e.g. the client ID for the Spotify Web API). It's stored in a file at $XDG_CONFIG_HOME/spotify-next/config.json or $HOME/.config/spotify-next/config.json (whichever works first). When you first run the application, or if that file is deleted, the application will ask and attempt to create one.

The configuration defines the port for the embedded HTTP server used for authentication. The server will only start when the login flow is triggered, and stop afterwards.

$ ./spotify-next --help

Usage:
    spotify-next login
    spotify-next skip
    spotify-next drop
    spotify-next forward
    spotify-next jump
    spotify-next s
    spotify-next d
    spotify-next f
    spotify-next j
    spotify-next repl

spotify-next: Gather great music.

Options and flags:
    --help
        Display this help text.
    --version, -v
        Print the version number and exit.

Subcommands:
    login
        Log into Spotify
    skip
        Skip to next track without any changes
    drop
        Drop current track from the current playlist and skip to the next track
    forward
        Fast forward the current track by a percentage of its length (10% by default)
    jump
        Fast forward the current track to the next section
    s
        Alias for `skip`
    d
        Alias for `drop`
    f
        Alias for `forward`
    j
        Alias for `jump`
    repl
        Run application in interactive mode

You can run the login command to be prompted for authorization, or you can rely on the fallback mechanism of all API calls - when one fails with 401 Unauthorized, you'll see the response and be prompted to log in. The call will be retried once after you successfully log in.

The application automatically saves the token to the configuration file after successful logins.

spotify-next's People

Contributors

scala-steward avatar kubukoz avatar mergify[bot] avatar valencik avatar peter-lavigne avatar toshihidetagami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.